From 3a67eaaa63d9f35c3d54c0ad5787606cacd7d90e Mon Sep 17 00:00:00 2001 From: bruce Date: Thu, 3 Oct 2024 15:02:47 +0800 Subject: [PATCH] build: Upgrade to go-1.23, Linter1.61.0 Upgrade to go-1.23, Linter1.61.0 Signed-off-by: bruce --- .golangci.yml | 8 +++++++- Makefile | 2 +- bootstrap/handlers/httpserver.go | 2 +- bootstrap/messaging/testcerts_test.go | 2 ++ go.mod | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 80195557..5f63a101 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,10 @@ linters: disable: enable: - - gosec \ No newline at end of file + - gosec +linters-settings: + gosec: + excludes: + # G115: integer overflow conversion + # exclude the rule since it tends to be false positive + - G115 diff --git a/Makefile b/Makefile index 301ebaf5..f8e43c08 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ lint: @if [ "z${ARCH}" = "zx86_64" ] && which golangci-lint >/dev/null ; then golangci-lint run --config .golangci.yml ; else echo "WARNING: Linting skipped (not on x86_64 or linter not installed)"; fi install-lint: - sudo curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.54.2 + sudo curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.61.0 test: unittest lint $(GO) vet ./... diff --git a/bootstrap/handlers/httpserver.go b/bootstrap/handlers/httpserver.go index 87b0efa9..9131a3e3 100644 --- a/bootstrap/handlers/httpserver.go +++ b/bootstrap/handlers/httpserver.go @@ -221,7 +221,7 @@ func (b *HttpServer) BootstrapHandler( for t.HasNotElapsed() { ln, listenErr := zitiCtx.Listen(ozServiceName) if listenErr != nil { - err = fmt.Errorf("could not bind service " + ozServiceName + ": " + listenErr.Error()) + err = fmt.Errorf("could not bind service %s: %s", ozServiceName, listenErr.Error()) t.SleepForInterval() } else { zc.c = &zitiCtx diff --git a/bootstrap/messaging/testcerts_test.go b/bootstrap/messaging/testcerts_test.go index 77028ce1..f37ac6a2 100644 --- a/bootstrap/messaging/testcerts_test.go +++ b/bootstrap/messaging/testcerts_test.go @@ -59,6 +59,8 @@ kX0EMnYch0e7urs9o1M6JWJGlWZQxgVnxekbFDPfRelR1m0zFnbfXG2rnfuRpVEL uXOR -----END CERTIFICATE----- ` + +// #nosec G101 const testClientKey = `-----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEA4TlobJoFgNoCc5Znb0OzVoMypoay1RSTAhnU0arpHVugUMZM O6oxSt371MN+e4cUxoes4uhNqeVG7AxUkdMCNJbzjAmJeDQtLKYHcY4YI30HHWCW diff --git a/go.mod b/go.mod index 43ade781..9b2522d4 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/edgexfoundry/go-mod-bootstrap/v3 -go 1.21 +go 1.23 require ( github.com/eclipse/paho.mqtt.golang v1.5.0