woblerr opened a new pull request, #82:
URL: https://github.com/apache/cloudberry-backup/pull/82

   This PR bumps go from 1.21 to 1.24, fixes all issues introduced by the 
version bump, and modernizes the linter and CI configuration.
   
   ## Motivation
   
   go 1.21 is EOL. At the same time, 
https://github.com/apache/cloudberry-go-libs  has already been bumped to go 
1.24.
   
   ## Changes
   
   * Bump go version:
       * Bump go from go `1.21` to `1.24`.
       * Fix all `go vet` printf analysis errors: non-constant format strings 
are now wrapped with explicit format directives (e.g., 
`gplog.Error(err.Error())` → `gplog.Error("%s", err.Error())`; 
`gplog.Error(fmt.Sprintf("...", args))` → `gplog.Error("...", args)`).
   
   * Bump linter to v2:
       * Bump golangci-lint from `1.16.0 `to `2.10.1`.
       * Replace `gometalinter.config` with `.golangci.yml` using golangci-lint 
v2 format.
       * Linter mapping: `golint` → `revive`, `vet` → `govet` (with shadow 
check), `varcheck` → `unused`; `unparam` and `errcheck` unchanged.
   
   * Fix linting issues:
       * Fix variable shadowing bugs where `:=` inside blocks silently hid 
outer `err` variables.
       * Fix a bug in `testutils/functions.go` where `host` parameter was 
shadowed, so `PGHOST` env var was never applied.
       * Remove unused `batchMapToString` and `contentMapToString` from 
`restore/data_test.go`.
       * Suppress pre-existing lint warnings in test files (shadow, errcheck, 
unparam) via `.golangci.yml` exclusions.
   
   * Remove deprecated code:
       * Replace `io/ioutil` usages with recommended alternatives from `os` and 
`io` packages.
       * Remove legacy `// +build` directives from all top-level `.go` files; 
`//go:build` is sufficient.
   
   * CI:
       * Bump go version in CI workflow to `1.24`.
       * Bump `actions/setup-go` from `v2` to `v5`.
   
   ## Verification
   
   M
   Unit tests pass without errors:
   
   ```bash
   $ make unit
   
   [1775594377] Textmsg Suite - 14/14 specs •••••••••••••• SUCCESS! 408.417µs 
PASS
   [1775594377] backup tests - 585/586 specs 
•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••S•••••••••••••••••••••••••••••••S•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
 
••••••••••••••••••••••••••••••••••••••••••••••••••S••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••S•••••••••••S•••••••••••••••••••••••••••••••••••••••S••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••P••••••••••••
 SUCCESS! 65.581208ms PASS
   [1775594377] TOC Suite - 45/45 specs 
••••••••••••••••••••••••••••••••••••••••••••• SUCCESS! 3.176667ms PASS
   [1775594377] restore tests - 118/118 specs 
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
 SUCCESS! 92.849459ms PASS
   [1775594377] testutils tests - 8/8 specs •••••••• SUCCESS! 763.458µs PASS
   [1775594377] utils tests - 118/118 specs 
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
 SUCCESS! 48.95175ms PASS
   [1775594377] Options Suite - 27/27 specs ••••••••••••••••••••••••••• 
SUCCESS! 5.474041ms PASS
   [1775594377] Cmd Suite - 14/14 specs •••••••••••••• SUCCESS! 6.274ms PASS
   [1775594377] Gpbckpconfig Suite - 47/47 specs 
••••••••••••••••••••••••••••••••••••••••••••••• SUCCESS! 1.842916ms PASS
   [1775594377] Filepath Suite - 31/31 specs ••••••••••••••••••••••••••••••• 
SUCCESS! 3.76675ms PASS
   [1775594377] History Suite - 8/8 specs •••••••• SUCCESS! 16.248625ms PASS
   [1775594377] s3_plugin tests - 32/32 specs •••••••••••••••••••••••••••••••• 
SUCCESS! 4.082709ms PASS
   [1775594377] Report Suite - 34/34 specs •••••••••••••••••••••••••••••••••• 
SUCCESS! 7.630792ms PASS
   
   Ginkgo ran 13 suites in 8.335478708s
   Test Suite Passed
   ```
   
   ## Not addressed in this PR
   
   The following improvements are outside the scope of this PR and should be 
considered separately:
   * Enable additional linters (`dupl`, `gocritic`, `gocyclo`, `gosec`, 
`ineffassign`, `misspell`, `nakedret`, `prealloc`, `staticcheck`, `unconvert`, 
etc.).
   * Fix pre-existing lint issues in test files (shadow, errcheck, unparam) 
that are currently suppressed via exclusions.
   * Bump go dependencies to their latest versions.
   * Updating go version above 1.24— current version aligns with the ecosystem, 
further upgrades should follow.
   
   ## Related links
   
   * 
https://github.com/apache/cloudberry-backup/issues/80#issuecomment-4194634510
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to