From a8b3c7580e5137eb4d34136d2f5628c3d1496dc2 Mon Sep 17 00:00:00 2001 From: Vladislav Byrgazov Date: Wed, 13 Nov 2024 15:50:39 +0500 Subject: [PATCH 1/3] Update go to 1.23 Signed-off-by: Vladislav Byrgazov --- .github/workflows/ci.yaml | 16 ++++++++-------- .golangci.yml | 23 ++++++++--------------- go.mod | 2 +- go.sum | 5 +++++ 4 files changed, 22 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 64b10683b..065ed2045 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -47,7 +47,7 @@ jobs: access_token: ${{ github.token }} - uses: actions/setup-go@v5 with: - go-version: 1.20.5 + go-version: 1.23.1 token: ${{ github.token }} - name: Set go env run: | @@ -97,7 +97,7 @@ jobs: access_token: ${{ github.token }} - uses: actions/setup-go@v5 with: - go-version: 1.20.5 + go-version: 1.23.1 token: ${{ github.token }} - name: Set go env run: | @@ -145,7 +145,7 @@ jobs: access_token: ${{ github.token }} - uses: actions/setup-go@v5 with: - go-version: 1.20.5 + go-version: 1.23.1 token: ${{ github.token }} - name: Set go env run: | @@ -194,7 +194,7 @@ jobs: df -h - uses: actions/setup-go@v5 with: - go-version: 1.20.5 + go-version: 1.23.1 token: ${{ github.token }} - name: Set go env run: | @@ -263,7 +263,7 @@ jobs: access_token: ${{ github.token }} - uses: actions/setup-go@v5 with: - go-version: 1.20.11 + go-version: 1.23.1 token: ${{ github.token }} - name: Set go env run: | @@ -312,7 +312,7 @@ jobs: df -h - uses: actions/setup-go@v5 with: - go-version: 1.20.5 + go-version: 1.23.1 token: ${{ github.token }} - name: Set go env run: | @@ -362,7 +362,7 @@ jobs: access_token: ${{ github.token }} - uses: actions/setup-go@v4 with: - go-version: 1.20.5 + go-version: 1.23.1 github-token: ${{ github.token }} - name: Set go env run: | @@ -413,7 +413,7 @@ jobs: df -h - uses: actions/setup-go@v5 with: - go-version: 1.20.5 + go-version: 1.23.1 token: ${{ github.token }} - name: Set go env run: | diff --git a/.golangci.yml b/.golangci.yml index 014df3ee9..60c0a7d11 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,7 +1,7 @@ --- run: # concurrency: 6 - go: '1.20' + go: '1.23' timeout: 2m issues-exit-code: 1 tests: true @@ -11,13 +11,14 @@ linters-settings: values: regexp: company: .* - copyright-holder: Copyright \(c\) ({{year-range}}) {{company}}\n\n + copyright-holder: Copyright \(c\) ({{mod-year-range}}) {{company}}\n\n copyright-holders: ({{copyright-holder}})+ errcheck: check-type-assertions: false check-blank: false govet: - check-shadowing: true + enable: + - shadow settings: printf: funcs: @@ -25,19 +26,15 @@ linters-settings: - (github.com/sirupsen/logrus.FieldLogger).Warnf - (github.com/sirupsen/logrus.FieldLogger).Errorf - (github.com/sirupsen/logrus.FieldLogger).Fatalf - golint: - min-confidence: 0.8 goimports: local-prefixes: github.com/networkservicemesh gocyclo: min-complexity: 15 - maligned: - suggest-new: true dupl: threshold: 150 funlen: - Lines: 100 - Statements: 50 + lines: 100 + statements: 50 goconst: min-len: 2 min-occurrences: 2 @@ -129,7 +126,6 @@ linters: enable: - goheader - bodyclose - - deadcode - depguard - dogsled - errcheck @@ -140,23 +136,20 @@ linters: - gocyclo - gofmt - goimports - - golint - gosec - gosimple - govet - ineffassign - - interfacer - misspell - nakedret - - scopelint - staticcheck - - structcheck - stylecheck - typecheck - unconvert - unparam - - varcheck - whitespace + - unused + - copyloopvar issues: exclude-rules: # We really *do* want to pass a pointer to an interface in these cases. See comments in file for New{Server,Client} diff --git a/go.mod b/go.mod index cb4ca7c91..23c726c9e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/networkservicemesh/integration-k8s-kind -go 1.20 +go 1.23 require ( github.com/networkservicemesh/integration-tests v0.0.0-20240923100516-0f5a7c947c8d diff --git a/go.sum b/go.sum index 42128b114..6916702c1 100644 --- a/go.sum +++ b/go.sum @@ -8,6 +8,7 @@ github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dv github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -20,6 +21,7 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= @@ -34,6 +36,7 @@ go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -45,10 +48,12 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= +golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From d593a40dde8ff4fd4d55f5ebaacb2543103ff89f Mon Sep 17 00:00:00 2001 From: Vladislav Byrgazov Date: Wed, 13 Nov 2024 15:52:07 +0500 Subject: [PATCH 2/3] Update go version to v1.23.3 Signed-off-by: Vladislav Byrgazov --- .github/workflows/ci.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 065ed2045..d51239860 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -47,7 +47,7 @@ jobs: access_token: ${{ github.token }} - uses: actions/setup-go@v5 with: - go-version: 1.23.1 + go-version: 1.23.3 token: ${{ github.token }} - name: Set go env run: | @@ -97,7 +97,7 @@ jobs: access_token: ${{ github.token }} - uses: actions/setup-go@v5 with: - go-version: 1.23.1 + go-version: 1.23.3 token: ${{ github.token }} - name: Set go env run: | @@ -145,7 +145,7 @@ jobs: access_token: ${{ github.token }} - uses: actions/setup-go@v5 with: - go-version: 1.23.1 + go-version: 1.23.3 token: ${{ github.token }} - name: Set go env run: | @@ -194,7 +194,7 @@ jobs: df -h - uses: actions/setup-go@v5 with: - go-version: 1.23.1 + go-version: 1.23.3 token: ${{ github.token }} - name: Set go env run: | @@ -263,7 +263,7 @@ jobs: access_token: ${{ github.token }} - uses: actions/setup-go@v5 with: - go-version: 1.23.1 + go-version: 1.23.3 token: ${{ github.token }} - name: Set go env run: | @@ -312,7 +312,7 @@ jobs: df -h - uses: actions/setup-go@v5 with: - go-version: 1.23.1 + go-version: 1.23.3 token: ${{ github.token }} - name: Set go env run: | @@ -362,7 +362,7 @@ jobs: access_token: ${{ github.token }} - uses: actions/setup-go@v4 with: - go-version: 1.23.1 + go-version: 1.23.3 github-token: ${{ github.token }} - name: Set go env run: | @@ -413,7 +413,7 @@ jobs: df -h - uses: actions/setup-go@v5 with: - go-version: 1.23.1 + go-version: 1.23.3 token: ${{ github.token }} - name: Set go env run: | From c71b7d58cb7bee024538b3a51ede12a44f3d19e0 Mon Sep 17 00:00:00 2001 From: Vladislav Byrgazov Date: Fri, 15 Nov 2024 13:43:19 +0500 Subject: [PATCH 3/3] Update linter config Signed-off-by: Vladislav Byrgazov --- .golangci.yml | 61 +++++++++++++++++++++++---------------------------- 1 file changed, 27 insertions(+), 34 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 60c0a7d11..72bb0505f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -26,6 +26,29 @@ linters-settings: - (github.com/sirupsen/logrus.FieldLogger).Warnf - (github.com/sirupsen/logrus.FieldLogger).Errorf - (github.com/sirupsen/logrus.FieldLogger).Fatalf + revive: + confidence: 0.8 + rules: + - name: exported + - name: blank-imports + - name: context-as-argument + - name: context-keys-type + - name: dot-imports + - name: error-return + - name: error-strings + - name: error-naming + - name: exported + - name: increment-decrement + - name: var-naming + - name: package-comments + - name: range + - name: receiver-naming + - name: time-naming + - name: unexported-return + - name: indent-error-flow + - name: errorf + - name: superfluous-else + - name: unreachable-code goimports: local-prefixes: github.com/networkservicemesh gocyclo: @@ -56,78 +79,48 @@ linters-settings: for-loops: false gocritic: enabled-checks: - - appendAssign - - assignOp - appendCombine - - argOrder - - badCall - - badCond - boolExprSimplify - builtinShadow - - captLocal - - caseOrder - - codegenComment - - commentFormatting - commentedOutCode - commentedOutImport - - defaultCaseOrder - - deprecatedComment - docStub - - dupArg - - dupBranchBody - - dupCase - dupImport - - dupSubExpr - - elseif - emptyFallthrough - emptyStringTest - equalFold - evalOrder - - exitAfterDefer - - flagDeref - - flagName - hexLiteral - hugeParam - - ifElseChain - importShadow - indexAlloc - initClause - methodExprCall - nestingReduce - - newDeref - nilValReturn - octalLiteral - - offBy1 - paramTypeCombine - rangeExprCopy - rangeValCopy - - regexpMust - regexpPattern - - singleCaseSwitch - - sloppyLen - sloppyReassign - stringXbytes - - switchTrue - typeAssertChain - - typeSwitchVar - typeUnparen - unlabelStmt - unnamedResult - unnecessaryBlock - - underef - - unlambda - - unslice - - valSwap - weakCond - - wrapperFunc - yodaStyleExpr linters: disable-all: true enable: - goheader - bodyclose + - unused - depguard - dogsled + - dupl - errcheck - funlen - gochecknoinits @@ -136,20 +129,20 @@ linters: - gocyclo - gofmt - goimports + - revive - gosec - gosimple - govet - ineffassign - misspell - nakedret + - copyloopvar - staticcheck - stylecheck - typecheck - unconvert - unparam - whitespace - - unused - - copyloopvar issues: exclude-rules: # We really *do* want to pass a pointer to an interface in these cases. See comments in file for New{Server,Client}