mirror of
https://github.com/ahmetb/kubectx.git
synced 2026-03-14 09:52:15 +00:00
Modernize the codebase to use idiomatic Go 1.25 patterns, removing deprecated APIs and reducing external dependencies.
- Replace deprecated `io/ioutil` with `os.ReadFile`, `os.WriteFile`, `os.MkdirTemp`, `os.CreateTemp`
- Replace `interface{}` with `any` (Go 1.18+)
- Remove `github.com/pkg/errors` dependency entirely, using stdlib `fmt.Errorf` with `%w` and `errors.New`
- Use `errors.As()` instead of direct type assertions on error values
- Use `strings.Cut()` for delimiter parsing instead of `strings.Split` + length check
- Use `slices.Contains()` for linear search in `ContextExists()`
- Use `t.Setenv()` and `t.TempDir()` in tests instead of manual env save/restore and temp dir cleanup
- Delete unused `internal/testutil/tempfile.go` helper
- Update GitHub Actions CI and release workflows from Go 1.22 to 1.25
Net result: -70 lines, 1 fewer external dependency.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
56 lines
2.2 KiB
Modula-2
56 lines
2.2 KiB
Modula-2
module github.com/ahmetb/kubectx
|
|
|
|
go 1.25.0
|
|
|
|
require (
|
|
facette.io/natsort v0.0.0-20181210072756-2cd4dd1e2dcb
|
|
github.com/fatih/color v1.18.0
|
|
github.com/google/go-cmp v0.7.0
|
|
github.com/mattn/go-isatty v0.0.20
|
|
k8s.io/apimachinery v0.35.2
|
|
k8s.io/client-go v0.35.2
|
|
sigs.k8s.io/kustomize/kyaml v0.21.1
|
|
)
|
|
|
|
require (
|
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
|
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
|
|
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
|
|
github.com/go-errors/errors v1.4.2 // indirect
|
|
github.com/go-logr/logr v1.4.3 // indirect
|
|
github.com/go-openapi/jsonpointer v0.21.0 // indirect
|
|
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
|
github.com/go-openapi/swag v0.23.0 // indirect
|
|
github.com/google/gnostic-models v0.7.0 // indirect
|
|
github.com/google/uuid v1.6.0 // indirect
|
|
github.com/josharian/intern v1.0.0 // indirect
|
|
github.com/json-iterator/go v1.1.12 // indirect
|
|
github.com/mailru/easyjson v0.7.7 // indirect
|
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
|
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
|
|
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
|
github.com/spf13/pflag v1.0.9 // indirect
|
|
github.com/x448/float16 v0.8.4 // indirect
|
|
go.yaml.in/yaml/v2 v2.4.3 // indirect
|
|
go.yaml.in/yaml/v3 v3.0.4 // indirect
|
|
golang.org/x/net v0.47.0 // indirect
|
|
golang.org/x/oauth2 v0.30.0 // indirect
|
|
golang.org/x/sys v0.38.0 // indirect
|
|
golang.org/x/term v0.37.0 // indirect
|
|
golang.org/x/text v0.31.0 // indirect
|
|
golang.org/x/time v0.9.0 // indirect
|
|
google.golang.org/protobuf v1.36.8 // indirect
|
|
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
|
|
gopkg.in/inf.v0 v0.9.1 // indirect
|
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
|
k8s.io/api v0.35.2 // indirect
|
|
k8s.io/klog/v2 v2.130.1 // indirect
|
|
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
|
|
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect
|
|
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
|
|
sigs.k8s.io/randfill v1.0.0 // indirect
|
|
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
|
|
sigs.k8s.io/yaml v1.6.0 // indirect
|
|
)
|