This is an automated email from the ASF dual-hosted git repository.

alexstocks pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/develop by this push:
     new 1d1f32a4f fix: update go version & golangci lint (#2830)
1d1f32a4f is described below

commit 1d1f32a4ffd06ba4267a351ce7743eae60060bc1
Author: Tom <[email protected]>
AuthorDate: Fri Apr 11 18:53:59 2025 +0800

    fix: update go version & golangci lint (#2830)
    
    * doc: update Contact part of README (#2824) (#2826)
    
    Co-authored-by: Alan <[email protected]>
    
    * fix: update go to 1.23
    
    * reverse to lint-action v6
    
    * specify golang-lint to v1.64.8
    
    * revert all irrelvant changes
    
    ---------
    
    Co-authored-by: Xin.Zh <[email protected]>
    Co-authored-by: Alan <[email protected]>
---
 .github/workflows/github-actions.yml |  2 +-
 .github/workflows/golangci-lint.yml  |  9 ++++-----
 .golangci.yml                        | 35 ++++++++++++-----------------------
 Makefile                             |  2 +-
 client/action.go                     |  2 +-
 go.mod                               |  2 +-
 go.sum                               |  2 ++
 7 files changed, 22 insertions(+), 32 deletions(-)

diff --git a/.github/workflows/github-actions.yml 
b/.github/workflows/github-actions.yml
index 0ed3f4429..0871b09c7 100644
--- a/.github/workflows/github-actions.yml
+++ b/.github/workflows/github-actions.yml
@@ -20,7 +20,7 @@ jobs:
       # If you want to matrix build , you can append the following list.
       matrix:
         go_version:
-          - '1.20'
+          - '1.23'
         os:
           - ubuntu-latest
 
diff --git a/.github/workflows/golangci-lint.yml 
b/.github/workflows/golangci-lint.yml
index 09fabeca7..c54934b58 100644
--- a/.github/workflows/golangci-lint.yml
+++ b/.github/workflows/golangci-lint.yml
@@ -11,14 +11,14 @@ permissions:
 jobs:
   golangci:
     permissions:
-      contents: read  # for actions/checkout to fetch code
-      pull-requests: read  # for golangci/golangci-lint-action to fetch pull 
requests
+      contents: read # for actions/checkout to fetch code
+      pull-requests: read # for golangci/golangci-lint-action to fetch pull 
requests
     name: lint
     runs-on: ubuntu-latest
     strategy:
       matrix:
         golang:
-          - '1.20'
+          - "1.23"
     steps:
       - uses: actions/setup-go@v5
         with:
@@ -27,6 +27,5 @@ jobs:
       - name: golangci-lint
         uses: golangci/golangci-lint-action@v6
         with:
-          version: v1.54
+          version: v1.64.8
           args: --timeout=10m
-          skip-go-installation: true
diff --git a/.golangci.yml b/.golangci.yml
index 6f214f445..79f2e8a70 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -1,25 +1,24 @@
 linters-settings:
   govet:
-    check-shadowing: true
-  golint:
-    min-confidence: 0
+    enable:
+      - shadow
   gocyclo:
     min-complexity: 10
-  maligned:
-    suggest-new: true
   dupl:
     threshold: 100
   goconst:
     min-len: 2
     min-occurrences: 2
   depguard:
-    list-type: blacklist
-    packages:
-      # logging is allowed only by logutils.Log, logrus
-      # is allowed to use only in logutils package
-      - github.com/sirupsen/logrus
+    rules:
+      main:
+        deny:
+          - pkg: "github.com/sirupsen/logrus"
+            desc: logging is allowed only by logutils.Log, logrus is allowed 
to use only in logutils package
   misspell:
     locale: US
+    ignore-words:
+      - nto
   lll:
     line-length: 140
   goimports:
@@ -40,11 +39,6 @@ linters:
     - ineffassign
     - misspell
 
-run:
-  skip-dirs:
-    - test/testdata_etc
-    - pkg/golinters/goanalysis/(checker|passes)
-
 issues:
   exclude-rules:
     - text: "weak cryptographic primitive"
@@ -53,11 +47,6 @@ issues:
     - linters:
         - staticcheck
       text: "SA1019:"
-
-# golangci.com configuration
-# https://github.com/golangci/golangci/wiki/Configuration
-service:
-  golangci-lint-version: 1.15.x # use the fixed version to not introduce new 
linters unexpectedly
-  prepare:
-    - echo "here I can run custom commands, but no preparation needed for this 
repo"
-
+  exclude-dirs:
+    - test/testdata_etc
+    - pkg/golinters/goanalysis/(checker|passes)
diff --git a/Makefile b/Makefile
index caa2546bb..5a6e7e19d 100644
--- a/Makefile
+++ b/Makefile
@@ -76,7 +76,7 @@ fmt:
 LOCALBIN ?= $(shell pwd)/bin
 $(LOCALBIN):
        mkdir -p $(LOCALBIN)
-GOLANG_LINT_VERSION ?= v1.44.2
+GOLANG_LINT_VERSION ?= v1.64.8
 GOLANG_LINT ?= $(LOCALBIN)/golangci-lint
 GOLANG_LINT_INSTALL_SCRIPT ?= 
"https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh";
 
diff --git a/client/action.go b/client/action.go
index c71efdfaf..c8c7efd6a 100644
--- a/client/action.go
+++ b/client/action.go
@@ -193,7 +193,7 @@ func processURL(ref *global.ReferenceConfig, regsCompat 
map[string]*config.Regis
                for _, urlStr := range urlStrings {
                        serviceURL, err := common.NewURL(urlStr, 
common.WithProtocol(ref.Protocol))
                        if err != nil {
-                               return nil, fmt.Errorf(fmt.Sprintf("url 
configuration error,  please check your configuration, user specified URL %v 
refer error, error message is %v ", urlStr, err.Error()))
+                               return nil, fmt.Errorf("url configuration 
error,  please check your configuration, user specified URL %v refer error, 
error message is %v ", urlStr, err.Error())
                        }
                        if serviceURL.Protocol == constant.RegistryProtocol { 
// serviceURL in this branch is a registry protocol
                                serviceURL.SubURL = cfgURL
diff --git a/go.mod b/go.mod
index 3e23b8ad2..6c77f48c8 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
 module dubbo.apache.org/dubbo-go/v3
 
-go 1.20
+go 1.23
 
 require (
        github.com/RoaringBitmap/roaring v1.2.3
diff --git a/go.sum b/go.sum
index 915d086df..d62a2b425 100644
--- a/go.sum
+++ b/go.sum
@@ -262,6 +262,7 @@ github.com/go-ole/go-ole v1.2.4/go.mod 
h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNI
 github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
 github.com/go-ole/go-ole v1.2.6/go.mod 
h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
 github.com/go-playground/assert/v2 v2.2.0 
h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
+github.com/go-playground/assert/v2 v2.2.0/go.mod 
h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
 github.com/go-playground/locales v0.14.1 
h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
 github.com/go-playground/locales v0.14.1/go.mod 
h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
 github.com/go-playground/universal-translator v0.18.1 
h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
@@ -882,6 +883,7 @@ go.uber.org/atomic v1.10.0 
h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ=
 go.uber.org/atomic v1.10.0/go.mod 
h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
 go.uber.org/goleak v1.1.11/go.mod 
h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
 go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA=
+go.uber.org/goleak v1.1.12/go.mod 
h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
 go.uber.org/multierr v1.1.0/go.mod 
h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
 go.uber.org/multierr v1.3.0/go.mod 
h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
 go.uber.org/multierr v1.5.0/go.mod 
h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=

Reply via email to