...
1# Tools
2
3This package contains imports to various tools used (eg, via `//go:generate`) within the hcsshim repo,
4allowing them to be versioned and ensuring their dependencies match what the shim use
5(specifically for auto-generated protobuf code).
6
7Calls to `go run <cmd/import/path>` (or `//go:generate go run <cmd/import/path>`) for go executables
8included here will use the version specified in `go.mod` and build the executable from vendored code.
9
10Using a dedicate package prevents callers who import `github.com/Microsoft/hcsshim` from including these
11tools in their dependencies.
12
13Based on golang [guidance].
14
15## Adding Dependencies
16
17To add a new dependency, add a `_ "cmd/import/path"` to `tools.go`, and then tidy and vendor the repo.
18
19In general executables used in auto-generating code (eg, `protobuild`, `protoc-gen-go-*`, and co.), or testing
20(eg, `gotestsum`, `benchstat`) should be included here.
21
22[guidance]: https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module
View as plain text