chore: modernize Go toolchain and dependencies - #3
Merged
Conversation
Go 1.22 changed bufio.Scanner so ErrFinalToken carrying a nil token no longer emits the final token. Return a non-nil empty slice instead so the trailing-newline line is preserved. Behavior is unchanged on Go < 1.22.
- Bump go directive from 1.20 to 1.26 (latest stable).
- Replace golang.org/x/exp/{slices,maps} with stdlib.
Go 1.23+ maps.Keys returns an iterator; use slices.Sorted to convert.
- Drop sirupsen/logrus — declared but never imported.
- Hoist liggitt/tabwriter and yaml.v3 from indirect to direct.
- Update CI (.github/workflows/ci.yaml) GO_VERSION from 1.21 to 1.26.
- Run gofmt.
- spf13/cobra v1.5.0 -> v1.10.2 - spf13/afero v1.9.2 -> v1.15.0 - stretchr/testify v1.8.0 -> v1.12.0 - golang.org/x/text v0.3.7 -> v0.41.0 (clears GO-2022-1059, GO-2026-5970) - indirect: mousetrap v1.1.0, pflag v1.0.9 No API breakage; build and full test suite pass.
The SystemAliasesCount field tag mixed literal tabs into the raw tag string, which newer go vet rejects as invalid reflect.StructTag syntax. Replace with spaces to match the alignment of the neighboring fields.
- actions/upload-artifact: v3 -> v4 (v3 hard-deprecated, auto-fails) - actions/download-artifact: v3 -> v4 (same deprecation) - actions/setup-go: v4 -> v5 (deprecated)
|
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.
What
Modernize the hostsctl project from its 2022-era dependency graph to current tooling:
bufio.Scannerchanged soErrFinalTokenwith aniltoken no longer emits the final token. Switch to non-nil sentinel.godirective 1.20 → 1.26; replacegolang.org/x/exp/{slices,maps}with stdlib; drop unusedsirupsen/logrus; promoteliggitt/tabwriter+yaml.v3to direct; bump CIGO_VERSION1.21 → 1.26.commands/block/model.gorejected by newergo vet.Verification
go build ./...✅go test ./...✅ (all 6 test packages pass)go vet ./...✅go mod verify✅