Skip to content

Update to Go 1.23-1.25, Actions v6, and golangci-lint v2.6.2#117

Merged
mattfarina merged 6 commits intomasterfrom
copilot/update-go-and-actions
Dec 2, 2025
Merged

Update to Go 1.23-1.25, Actions v6, and golangci-lint v2.6.2#117
mattfarina merged 6 commits intomasterfrom
copilot/update-go-and-actions

Conversation

Copy link
Contributor

Copilot AI commented Dec 1, 2025

  • Update Go versions in workflow files to latest 3 versions (1.23.x, 1.24.x, 1.25.x)
  • Update go.mod to use Go 1.23
  • Update actions/setup-go from v1 to v6 in workflow files
  • Update actions/checkout from v1 to v6 in workflow files
  • Update golangci-lint version in Makefile to v2.6.2
  • Convert .golangci.yml to .golangci.yaml with new v2 configuration format
  • Fix local-prefixes in goimports configuration
  • Replace deprecated io/ioutil with io and os packages
  • Replace os.MkdirTemp with t.TempDir in test files
  • Fix all golangci-lint issues (0 issues remaining)
  • Test the changes by running lint and build
Original prompt

This section details on the original issue you should resolve

<issue_title>Update to latest Go and Actions</issue_title>
<issue_description>Update to the latest 3 versions of Go. This includes upgrading golangci-lint. Also, upgrade the Actions used to install go and checkout source.</issue_description>

<agent_instructions>golangci-lint needs to be updated to the new configuration file format.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits December 1, 2025 20:28
- Update Go versions to 1.23.x, 1.24.x, 1.25.x in workflow files
- Update actions/setup-go from v1 to v6
- Update actions/checkout from v1 to v6
- Update golangci-lint from v1.45.0 to v2.6.2
- Migrate .golangci.yml to .golangci.yaml with v2 config format
- Remove deprecated linters (deadcode, structcheck, varcheck, gosimple)
- Add formatters section for gofmt and goimports
- Update go.mod to Go 1.23

Co-authored-by: mattfarina <62991+mattfarina@users.noreply.github.com>
Update local-prefixes from helm.sh/helm/v3 to github.com/Masterminds/vcs
to match the actual module path of this repository.

Co-authored-by: mattfarina <62991+mattfarina@users.noreply.github.com>
Copilot AI changed the title [WIP] Update to latest Go versions and Actions Update to Go 1.23-1.25, Actions v6, and golangci-lint v2.6.2 Dec 1, 2025
Copilot AI requested a review from mattfarina December 1, 2025 20:33
@mattfarina
Copy link
Member

@copilot io/ioutil is deprecated. Update the io/ioutil use to the new functions that replace its use.

- Replace io/ioutil imports with io and os
- Replace ioutil.ReadFile with os.ReadFile
- Replace ioutil.ReadAll with io.ReadAll
- Replace ioutil.Discard with io.Discard
- Replace ioutil.TempDir with os.MkdirTemp
- Update code comments to use new function names

Co-authored-by: mattfarina <62991+mattfarina@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 1, 2025

@copilot io/ioutil is deprecated. Update the io/ioutil use to the new functions that replace its use.

Updated all deprecated io/ioutil usage to use io and os packages. Changed ioutil.ReadFile to os.ReadFile, ioutil.ReadAll to io.ReadAll, ioutil.Discard to io.Discard, and ioutil.TempDir to os.MkdirTemp across all files. Commit: a1b8b92

@mattfarina
Copy link
Member

@copilot In the test files, replace the use of os.MkdirTemp and its error handling with t.TempDir

Replace os.MkdirTemp and manual cleanup with t.TempDir() which:
- Automatically creates a temporary directory
- Handles cleanup automatically when the test completes
- Simplifies test code by removing error handling and defer statements

This change reduces boilerplate code in test files while maintaining
the same functionality.

Co-authored-by: mattfarina <62991+mattfarina@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 1, 2025

@copilot In the test files, replace the use of os.MkdirTemp and its error handling with t.TempDir

Replaced os.MkdirTemp and manual cleanup with t.TempDir() in all test files. This simplifies the test code by automatically handling directory creation and cleanup. Commit: c682014

@mattfarina
Copy link
Member

@copilot Fix the pull request so that it passes golangci-lint

- Run gofmt to fix formatting issues (blank lines, comment alignment)
- Handle error return values properly (errcheck)
  - Check return value from handleSubmodules
  - Use explicit blank identifier for deferred Close() calls
- Remove deprecated build tags (keep only //go:build directives)
- Fix error string capitalization (staticcheck ST1005)
- Replace unused parameters with blank identifier (revive)
- Use strings.ReplaceAll instead of strings.Replace (staticcheck QF1004)
- Remove superfluous else after continue (revive)
- Convert if-else chains to switch statements (staticcheck QF1003)
- Make naked returns explicit in parseImportFromBody (nakedret)

All linter checks now pass with 0 issues.

Co-authored-by: mattfarina <62991+mattfarina@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 1, 2025

@copilot Fix the pull request so that it passes golangci-lint

Fixed all golangci-lint issues. The PR now passes with 0 linter issues. Changes include proper error handling, removed deprecated build tags, fixed error string capitalization, replaced unused parameters with blank identifiers, improved code style with switch statements, and made naked returns explicit. Commit: f124a14

@mattfarina mattfarina marked this pull request as ready for review December 1, 2025 21:27
@mattfarina mattfarina merged commit a54ec74 into master Dec 2, 2025
6 checks passed
@mattfarina mattfarina deleted the copilot/update-go-and-actions branch December 2, 2025 14:46
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.

Update to latest Go and Actions

2 participants