Skip to content

chore: Update go version, deps, linting, and CI#60

Merged
rnubel merged 6 commits into
masterfrom
update-go-deps
Mar 31, 2026
Merged

chore: Update go version, deps, linting, and CI#60
rnubel merged 6 commits into
masterfrom
update-go-deps

Conversation

@rnubel
Copy link
Copy Markdown
Owner

@rnubel rnubel commented Mar 24, 2026

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ioutil usage with os equivalents 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.

Comment thread pgmgr/config.go Outdated
Comment thread pgmgr/config.go Outdated
Comment thread pgmgr/pgmgr.go Outdated
Comment thread pgmgr/pgmgr.go
Comment thread pgmgr/pgmgr.go
rnubel added 5 commits March 31, 2026 08:21
- 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
@rnubel rnubel merged commit 16bf1ea into master Mar 31, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants