From 4ce11c039ecad7ade4d6b286492143bd75a3f771 Mon Sep 17 00:00:00 2001 From: Dan Sosedoff Date: Tue, 11 Nov 2025 11:26:49 -0800 Subject: [PATCH] Bump golangci-linter to 1.62.2 (#772) * Bump golangci-linter to 1.62.2 * Address linting warning via change or ignore --- .github/workflows/checks.yml | 2 +- pkg/client/client_test.go | 4 +++- pkg/client/util.go | 4 ++-- pkg/connection/connection_string.go | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 7880b82..a627bf9 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -97,7 +97,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.57.1 + version: v1.62.2 fmt: name: fmt diff --git a/pkg/client/client_test.go b/pkg/client/client_test.go index 7e84e0c..011e1b2 100644 --- a/pkg/client/client_test.go +++ b/pkg/client/client_test.go @@ -57,7 +57,9 @@ func assertMatches(t *testing.T, expected, src []string) { func pgVersion() (int, int) { var major, minor int - fmt.Sscanf(os.Getenv("PGVERSION"), "%d.%d", &major, &minor) + if _, err := fmt.Sscanf(os.Getenv("PGVERSION"), "%d.%d", &major, &minor); err != nil { + log.Println("[warn] unable to read value of PGVERSION env var") + } return major, minor } diff --git a/pkg/client/util.go b/pkg/client/util.go index c665d10..b7a7fb4 100644 --- a/pkg/client/util.go +++ b/pkg/client/util.go @@ -28,9 +28,9 @@ var ( // Example: 10.2.3.1 -> 10.2 func getMajorMinorVersion(str string) (major int, minor int) { chunks := strings.Split(str, ".") - fmt.Sscanf(chunks[0], "%d", &major) + fmt.Sscanf(chunks[0], "%d", &major) //nolint if len(chunks) > 1 { - fmt.Sscanf(chunks[1], "%d", &minor) + fmt.Sscanf(chunks[1], "%d", &minor) //nolint } return } diff --git a/pkg/connection/connection_string.go b/pkg/connection/connection_string.go index f5f22b1..c5b4cf6 100644 --- a/pkg/connection/connection_string.go +++ b/pkg/connection/connection_string.go @@ -178,7 +178,7 @@ func lookupPassword(opts command.Options, url *neturl.URL) string { if url != nil { var dbName string - fmt.Sscanf(url.Path, "/%s", &dbName) + fmt.Sscanf(url.Path, "/%s", &dbName) //nolint return passfile.FindPassword( url.Hostname(),