chore: Update go version, deps, linting, and CI#60
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR modernizes the Go toolchain/dependencies and updates CI/linting, while also tightening error handling around file/DB operations in pgmgr.
Changes:
- Replace deprecated
ioutilusage withosequivalents and improve error handling in tests and core logic. - Update Go module dependencies and CI tooling (checkout/setup-go, golangci-lint action).
- Adjust CLI behavior to propagate/display errors more consistently.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
pgmgr/pgmgr_test.go |
Switch to os.ReadFile/os.WriteFile and add missing error checks in tests. |
pgmgr/pgmgr.go |
Improve error handling for file writes/closes, temp files, and some time/defer patterns. |
pgmgr/dump_config_test.go |
Assert LoadConfig errors in dump config tests. |
pgmgr/config_test.go |
Assert LoadConfig errors and check os.Setenv return values. |
pgmgr/config.go |
Replace ioutil.ReadFile and add JSON unmarshal error reporting; tweak validation error string. |
main.go |
Propagate rollback/app errors instead of ignoring them. |
go.mod |
Bump Go version directive and update direct/indirect dependencies. |
go.sum |
Refresh sums for updated dependencies. |
.github/workflows/ci.yml |
Update actions, switch to golangci-lint action, and bump Go/container versions. |
.gitignore |
Ignore .worktrees/. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Bump go directive from 1.12 to 1.24 - Update github.com/lib/pq v1.2.0 -> v1.12.0 - Update github.com/urfave/cli v1.22.1 -> v1.22.17 - Update indirect deps via go mod tidy - Fix non-constant format string in fmt.Fprintf (surfaced by stricter go vet under go 1.24)
- Bump go-version from 1.17 to 1.24 in lint job - Pin container to golang:1.24-alpine instead of unversioned golang:alpine - Upgrade actions/checkout v3 -> v4 - Upgrade actions/setup-go v2 -> v5 - Remove golint (deprecated/archived); go vet is sufficient
- Replace all io/ioutil usage with os equivalents (ReadFile, WriteFile,
ReadDir, CreateTemp) — ioutil is deprecated since Go 1.16
- Fix errcheck: check errors from json.Unmarshal, file.Write, file.Close,
tmpfile.WriteString, Initialize, LoadConfig, os.Setenv, testSh, and
app.Run in main
- Fix QF1012: replace WriteString(fmt.Sprintf(...)) with fmt.Fprintf(...)
- Fix defer ordering: move defer db.Close() after nil check on connection
- Annotate genuinely best-effort defers (db.Close, tx.Rollback, os.Remove,
rm cleanup) with //nolint:errcheck
- Fix time.Now().Sub(t0) -> time.Since(t0) (2 occurrences)
- Fix ineffassign in tests: add error checks on second Version() and Rollback()
- Lowercase error string to satisfy ST1005 ('format must be...')
- Fix main.go: Rollback, help command, and app.Run now propagate errors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.