From 76b5ee7df605b8161e32c302a911fa624136ac1d Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Fri, 6 Sep 2024 15:23:45 -0400 Subject: [PATCH 1/2] Update to Go 1.23. Fixes #2385 --- CHANGELOG.md | 6 ++++++ go.mod | 4 ++-- zititest/go.mod | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e8450425..b12526314 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# Release 1.1.11 + +# What's New + +* This release updates to Go v1.23. No other changes are included in the release + # Release 1.1.10 ## What's New diff --git a/go.mod b/go.mod index 52842f96f..4b26ed650 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/openziti/ziti -go 1.22.0 +go 1.23 -toolchain go1.22.5 +toolchain go1.23.0 require ( github.com/AppsFlyer/go-sundheit v0.6.0 diff --git a/zititest/go.mod b/zititest/go.mod index 0f4dbf8d3..7fc94e6b1 100644 --- a/zititest/go.mod +++ b/zititest/go.mod @@ -1,8 +1,8 @@ module github.com/openziti/ziti/zititest -go 1.22.0 +go 1.23.1 -toolchain go1.22.1 +toolchain go1.23.1 replace github.com/openziti/ziti => ../ From ca66653f8ad23f7579726d1500f47f77f0484361 Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Fri, 6 Sep 2024 16:23:31 -0400 Subject: [PATCH 2/2] Update linter and fix issues caught by updated linter --- .github/workflows/golangci-lint.yml | 2 +- CHANGELOG.md | 4 +++- controller/db/posture_check_os.go | 2 +- router/xgress_edge/dialer.go | 2 +- ziti/cmd/fabric/validate_router_data_model.go | 2 +- ziti/pki/store/local.go | 8 ++++++-- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index d721730fb..cdbf6fefc 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -28,7 +28,7 @@ jobs: uses: golangci/golangci-lint-action@v6 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: v1.57.2 + version: v1.60.3 # Optional: working directory, useful for monorepos # working-directory: somedir diff --git a/CHANGELOG.md b/CHANGELOG.md index b12526314..48e4b7ee1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ # What's New -* This release updates to Go v1.23. No other changes are included in the release +* This release updates to Go v1.23 +* Updates to the latest version of golangci-lint, to allow it to work with the new version of Go +* Linter fixes to address issues caught by updated linter # Release 1.1.10 diff --git a/controller/db/posture_check_os.go b/controller/db/posture_check_os.go index 5a002f2f0..42859a3a3 100644 --- a/controller/db/posture_check_os.go +++ b/controller/db/posture_check_os.go @@ -71,7 +71,7 @@ func (entity *PostureCheckOperatingSystem) SetValues(ctx *boltz.PersistContext, if _, found := osMap[string(key)]; !found { err := bucket.DeleteBucket(key) if err != nil { - pfxlog.Logger().Errorf(err.Error()) + pfxlog.Logger().WithError(err).Errorf("error resetting posture check os values") } } } diff --git a/router/xgress_edge/dialer.go b/router/xgress_edge/dialer.go index 0d11a9bb5..517dadc4c 100644 --- a/router/xgress_edge/dialer.go +++ b/router/xgress_edge/dialer.go @@ -148,7 +148,7 @@ func (dialer *dialer) Dial(params xgress.DialParams) (xt.PeerData, error) { log.Info(msg) conn.close(false, msg) x.Close() - return nil, fmt.Errorf(msg) + return nil, errors.New(msg) } log.Debug("dial success") diff --git a/ziti/cmd/fabric/validate_router_data_model.go b/ziti/cmd/fabric/validate_router_data_model.go index a3b22240c..786b89538 100644 --- a/ziti/cmd/fabric/validate_router_data_model.go +++ b/ziti/cmd/fabric/validate_router_data_model.go @@ -127,7 +127,7 @@ func (self *validateRouterDataModelAction) validateRouterDataModel(_ *cobra.Comm for _, errDetail := range detail.Errors { outputHeader() - fmt.Printf("\t" + errDetail + "\n") + fmt.Printf("\t%s\n", errDetail) errCount++ } expected-- diff --git a/ziti/pki/store/local.go b/ziti/pki/store/local.go index d7c54e227..154d08e11 100644 --- a/ziti/pki/store/local.go +++ b/ziti/pki/store/local.go @@ -384,7 +384,9 @@ func (l *Local) Update(caName string, sn *big.Int, st certificate.State) error { } matchedSerial := big.NewInt(0) - fmt.Sscanf(matches[4], "%X", matchedSerial) + if _, err = fmt.Sscanf(matches[4], "%X", matchedSerial); err != nil { + return err + } if matchedSerial.Cmp(sn) == 0 { if matches[1] == state { return nil @@ -442,7 +444,9 @@ func (l *Local) Revoked(caName string) ([]pkix.RevokedCertificate, error) { } sn := big.NewInt(0) - fmt.Sscanf(matches[4], "%X", sn) + if _, err = fmt.Sscanf(matches[4], "%X", sn); err != nil { + return nil, err + } t, err := time.Parse("060102150405", strings.TrimSuffix(matches[3], "Z")) if err != nil { return nil, fmt.Errorf("failed parsing revocation time %v: %v", matches[3], err)