Skip to content

Conversation

@cburgess
Copy link

This commit modernizes CI infrastructure and prepares the codebase for future Go version upgrades by documenting all deprecated ioutil usages.

CI Modernization

  • Update actions/checkout from v3 to v6
  • Update actions/setup-go from v4 to v6
  • Add explicit permissions block for security best practices
  • Extend Go version matrix to include 1.22.x through 1.25.x
  • Remove Go 1.11.x from CI matrix (go.mod specifies go 1.12)
  • Maintain backward compatibility with Go 1.12.x through 1.21.x

Build Constraint Cleanup

Merge parse/testdata/subcommand_1.9.go into subcommands.go. The go1.9 build constraint is obsolete since the minimum supported version (1.12) already supports type aliases. This simplifies the test fixtures.

Deprecated ioutil Documentation

Add TODO comments to all ioutil package usages documenting:

  • Which function is deprecated
  • The modern replacement (available since Go 1.16)
  • Reference to the Go 1.16 release notes

The ioutil package was deprecated in Go 1.16, but the code continues to work correctly. These comments prepare for a future migration when the minimum Go version is raised to 1.16+.

Affected functions and their replacements:

  • ioutil.Discard -> io.Discard
  • ioutil.TempDir -> os.MkdirTemp
  • ioutil.TempFile -> os.CreateTemp
  • ioutil.ReadFile -> os.ReadFile
  • ioutil.WriteFile -> os.WriteFile
  • ioutil.ReadDir -> os.ReadDir

Test Fix

Fix TestBootstrap to use go env GOBIN instead of hardcoded $GOPATH/bin, which may not be set in module-aware mode (Go 1.16+ defaults to module mode).

Compatibility

  • Minimum Go version: 1.12 (unchanged, now enforced in CI)
  • No API changes
  • All existing tests continue to pass

This commit modernizes CI infrastructure and prepares the codebase for
future Go version upgrades by documenting all deprecated ioutil usages.

## CI Modernization

- Update actions/checkout from v3 to v6
- Update actions/setup-go from v4 to v6
- Add explicit permissions block for security best practices
- Extend Go version matrix to include 1.22.x through 1.25.x
- Remove Go 1.11.x from CI matrix (go.mod specifies go 1.12)
- Maintain backward compatibility with Go 1.12.x through 1.21.x

## Build Constraint Cleanup

Merge parse/testdata/subcommand_1.9.go into subcommands.go. The go1.9
build constraint is obsolete since the minimum supported version (1.12)
already supports type aliases. This simplifies the test fixtures.

## Deprecated ioutil Documentation

Add TODO comments to all ioutil package usages documenting:
- Which function is deprecated
- The modern replacement (available since Go 1.16)
- Reference to the Go 1.16 release notes

The ioutil package was deprecated in Go 1.16, but the code continues to
work correctly. These comments prepare for a future migration when the
minimum Go version is raised to 1.16+.

Affected functions and their replacements:
- ioutil.Discard    -> io.Discard
- ioutil.TempDir    -> os.MkdirTemp
- ioutil.TempFile   -> os.CreateTemp
- ioutil.ReadFile   -> os.ReadFile
- ioutil.WriteFile  -> os.WriteFile
- ioutil.ReadDir    -> os.ReadDir

## Test Fix

Fix TestBootstrap to use `go env GOBIN` instead of hardcoded
$GOPATH/bin, which may not be set in module-aware mode (Go 1.16+
defaults to module mode).

## Compatibility

- Minimum Go version: 1.12 (unchanged, now enforced in CI)
- No API changes
- All existing tests continue to pass
@cburgess
Copy link
Author

cburgess commented Jan 22, 2026

resolves #534

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.

1 participant