k8s.io/test-infra@v0.0.0-20240520184403-27c6b4c223d8/docs/dep.md (about) 1 # kubernetes/test-infra dependency management 2 3 test-infra uses [go modules] for Go dependency management. 4 5 ## Usage 6 7 Run [`make update-go-deps`] whenever vendored dependencies change. 8 9 ### Updating dependencies 10 11 New dependencies causes golang to recompute the minor version used for each major version of each dependency. And 12 golang automatically removes dependencies that nothing imports any more. 13 14 See golang's [go.mod] and [dependency upgrade] docs for more details. 15 16 ### No `replace` directives! 17 18 Please DO NOT add any "replace" directives to go.mod files in this repo. 19 This is problematic for published packages, specifically preventing the use of `go install` or `go get` to 20 use package fom this repo. See [this comment](https://github.com/golang/go/issues/44840#issuecomment-1651863470) 21 for a complete explanation. 22 23 ### Tips 24 25 Use `hack/make-rules/go-run/arbitrary.sh whatever` rather than `go whatever` from your `$PATH` to ensure the correct version of golang is selected. 26 27 Note that using this path does not otherwise require golang to be installed on your workstation. 28 29 [dependency upgrade]: https://github.com/golang/go/wiki/Modules#how-to-upgrade-and-downgrade-dependencies 30 [go.mod]: https://github.com/golang/go/wiki/Modules#gomod 31 [go modules]: https://github.com/golang/go/wiki/Modules