linkerd2/controller/api/destination/watcher
Alex Leong 3dcff52b9f
Switch from using golangci fmt to using goimports (#3555)
CI currently enforcing formatting rules by using the fmt linter of golang-ci-lint which is invoked from the bin/lint script.  However it doesn't seem possible to use golang-ci-lint as a formatter, only as a linter which checks formatting.  This means any formatter used by your IDE or invoked manually may or may not use the same formatting rules as golang-ci-lint depending on which formatter you use and which specific revision of that formatter you use.  

In this change we stop using golang-ci-lint for format checking.  We introduce `tools.go` and add goimports to the `go.mod` and `go.sum` files.  This allows everyone to easily get the same revision of goimports by running `go install -mod=readonly golang.org/x/tools/cmd/goimports` from inside of the project.  We add a step in the CI workflow that uses goimports via the `bin/fmt` script to check formatting.

Some shell gymnastics were required in the `bin/fmt` script to work around some limitations of `goimports`:
* goimports does not have a built-in mechanism for excluding directories, and we need to exclude the vendor director as well as the generated Go sources
* goimports returns a 0 exit code, even when formatting errors are detected

Signed-off-by: Alex Leong <alex@buoyant.io>
2019-10-16 13:56:11 -07:00
..
endpoints_watcher.go The linkerd proxy does not work with headless services (#3470) 2019-10-15 14:56:41 -07:00
endpoints_watcher_test.go The linkerd proxy does not work with headless services (#3470) 2019-10-15 14:56:41 -07:00
k8s.go Return invalid argument for external name services (#3120) 2019-07-29 16:31:22 -07:00
profile_watcher.go Switch from using golangci fmt to using goimports (#3555) 2019-10-16 13:56:11 -07:00
profile_watcher_test.go Add support for stateful sets (#3113) 2019-07-24 14:09:46 -07:00
prometheus.go Add support for stateful sets (#3113) 2019-07-24 14:09:46 -07:00
test_util.go Update ServiceProfile CRD to version v1alpha2 and remove validation (#3078) 2019-07-23 11:46:31 -07:00
traffic_split_watcher.go Cleanup: fix some typos in code comment (#3296) 2019-08-21 09:40:43 -07:00
traffic_split_watcher_test.go Add traffic splitting to destination profiles (#2931) 2019-06-28 13:19:47 -07:00