-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update go to 1.23 #177
Update go to 1.23 #177
Conversation
Signed-off-by: Vladislav Byrgazov <[email protected]>
Signed-off-by: Vladislav Byrgazov <[email protected]>
Signed-off-by: Vladislav Byrgazov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I can see go mod tidy job is still using go1.20.
Consider re-using jobs from .github
repository in ci.yaml workflow. See at https://github.com/networkservicemesh/sdk/blob/main/.github/workflows/ci.yaml
Signed-off-by: Vladislav Byrgazov <[email protected]>
Signed-off-by: Vladislav Byrgazov <[email protected]>
Signed-off-by: Vladislav Byrgazov <[email protected]>
@Ex4amp1e I've found that we can a bit improve the proposed golangci config. diff --git a/.golangci.yml b/.golangci.yml
index 118e88e..083e85d 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -26,6 +26,35 @@ linters-settings:
- (github.com/sirupsen/logrus.FieldLogger).Warnf
- (github.com/sirupsen/logrus.FieldLogger).Errorf
- (github.com/sirupsen/logrus.FieldLogger).Fatalf
+ depguard:
+ rules:
+ main:
+ deny:
+ - pkg: "errors"
+ desc: "Please use \"github.com/pkg/errors\" instead of \"errors\" in go imports"
+ 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/api
gocyclo:
@@ -35,6 +64,8 @@ linters-settings:
goconst:
min-len: 2
min-occurrences: 2
+ lll:
+ line-length: 160
misspell:
locale: US
unparam:
@@ -45,80 +76,46 @@ linters-settings:
simple: true
range-loops: true
for-loops: false
- gosec:
- excludes:
- - G115
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
- - ptrToRefParam
- 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:
+ - depguard
+ - revive
- rowserrcheck
- goheader
- bodyclose
@@ -136,7 +133,7 @@ linters:
- gosimple
- govet
- ineffassign
- # - lll
+ - lll
- misspell
- nakedret
- staticcheck
@@ -155,3 +152,7 @@ issues:
linters:
- funlen
text: "Function 'TestParsePortRange' is too long"
+ - path: pkg/api/networkservice
+ linters:
+ - gosec
+ text: "G115"
diff --git a/pkg/api/networkservice/mechanisms/kernel/helpers.go b/pkg/api/networkservice/mechanisms/kernel/helpers.go
index 1565208..6c53f29 100644
--- a/pkg/api/networkservice/mechanisms/kernel/helpers.go
+++ b/pkg/api/networkservice/mechanisms/kernel/helpers.go
@@ -23,12 +23,13 @@ package kernel
import (
"bytes"
- "errors"
"net"
"strconv"
"strings"
"text/template"
+ "github.com/pkg/errors"
+
"github.com/networkservicemesh/api/pkg/api/networkservice"
"github.com/networkservicemesh/api/pkg/api/networkservice/mechanisms/cls"
)
|
Signed-off-by: Vladislav Byrgazov <[email protected]>
…i@main PR link: networkservicemesh/api#177 Commit: df76555 Author: Vladislav Byrgazov Date: 2024-11-14 15:29:31 +0500 Message: - Update go to 1.23 (#177) * Update go to 1.23 Signed-off-by: Vladislav Byrgazov <[email protected]> * Update copyright-holder regexp Signed-off-by: Vladislav Byrgazov <[email protected]> * Fix set of enabled linters Signed-off-by: Vladislav Byrgazov <[email protected]> * Fix go-version Signed-off-by: Vladislav Byrgazov <[email protected]> * Reuse jobs from .github Signed-off-by: Vladislav Byrgazov <[email protected]> * Fix estrict-nsm-deps workflow Signed-off-by: Vladislav Byrgazov <[email protected]> * Improve golangci config Signed-off-by: Vladislav Byrgazov <[email protected]> --------- Signed-off-by: Vladislav Byrgazov <[email protected]> Signed-off-by: NSMBot <[email protected]>
Issue: networkservicemesh/deployments-k8s#12294