Skip to content

Apply Go 1.26.1 coding standards via go fix - #30

Merged
tomodian merged 2 commits into
developfrom
copilot/apply-go-1-26-1-standards
Mar 10, 2026
Merged

Apply Go 1.26.1 coding standards via go fix#30
tomodian merged 2 commits into
developfrom
copilot/apply-go-1-26-1-standards

Conversation

Copilot AI commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

Run go fix ./... to apply all Go 1.26.1 idiomatic transformations across the codebase.

  • Deprecated io/ioutil removal (files/reader.go, files/writer.go): ioutil.ReadFile / ioutil.WriteFileos.ReadFile / os.WriteFile
  • slices package adoption (files/glob.go): sort.Sliceslices.Sort; manual containment loop → slices.Contains
  • Iterator usage (parser/parser.go): for _, line := range strings.Split(...)for line := range strings.SplitSeq(...) in Show, Latest, LatestAny — avoids intermediate slice allocation
// Before
for _, line := range strings.Split(doc, "\n") { ... }

// After
for line := range strings.SplitSeq(doc, "\n") { ... }

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • get.anchore.io
    • Triggering command: /usr/bin/curl curl -w %{http_code} -sL -o /tmp/tmp.YLLerNsPIR REDACTED -gensymabis -o /tmp/go-build1384428979/b005/symabis /opt/hostedtoolcache/go/1.24.13/x64/src/internal/abi/abi_test.s /opt/hostedtoolcache/go/1.24.13/x64/src/internal/abi/stub.s -###�� -x c rg/toolchain@v0.0.1-go1.26.1.linux-amd64/pkg/tool/linux_amd64/asm - x l/linux_amd64/fi/tmp/go-build1384428979/b011/_pkg_.a rg/toolchain@v0.-trimpath (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


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

- files/reader.go: Replace deprecated ioutil.ReadFile with os.ReadFile
- files/writer.go: Replace deprecated ioutil.WriteFile with os.WriteFile
- files/glob.go: Replace sort.Slice with slices.Sort
- files/glob.go: Replace manual loop with slices.Contains
- parser/parser.go: Replace strings.Split with strings.SplitSeq in 3 for-range loops

Co-authored-by: tomodian <158877+tomodian@users.noreply.github.com>
@tomodian
tomodian marked this pull request as ready for review March 10, 2026 15:30
Copilot AI changed the title [WIP] Apply Go 1.26.1 coding standards to the codebase Apply Go 1.26.1 coding standards via go fix Mar 10, 2026
@tomodian
tomodian merged commit e582a8b into develop Mar 10, 2026
5 checks passed
@tomodian
tomodian deleted the copilot/apply-go-1-26-1-standards branch March 10, 2026 15:32
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