Skip to content

Commit

Permalink
Use go install instead of go get
Browse files Browse the repository at this point in the history
With Go 1.16, switch to `go install` for tools in preparation of the `go get`r
install deprecation.

Change `counterfeiter` location from needing to be under `GOPATH` to ber
anywhere as long as it is in the `PATH`.

Signed-off-by: Mayukh Sarkar <[email protected]>
  • Loading branch information
HeavyWombat authored and mayukh-sarkar-1 committed Sep 16, 2021
1 parent 2e25c29 commit 6263f40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ jobs:

- name: Install Tools
run: |
pushd $(mktemp -d)
go get github.com/gordonklaus/ineffassign
go get golang.org/x/lint/golint
go get github.com/client9/misspell/cmd/misspell
go get honnef.co/go/tools/cmd/staticcheck
popd
go install github.com/gordonklaus/ineffassign@latest
go install golang.org/x/lint/golint@latest
go install github.com/client9/misspell/cmd/misspell@latest
go install honnef.co/go/tools/cmd/staticcheck@latest
go install github.com/maxbrunsfeld/counterfeiter/v6@latest
- run: make govet
- run: make ineffassign
Expand Down
7 changes: 3 additions & 4 deletions hack/generate-fakes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ set -euo pipefail
[ ! -d "vendor" ] && echo "$0 requires vendor/ folder, run 'go mod vendor'"

SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
BIN=$(go env GOPATH)/bin

GO111MODULE=off "${BIN}/counterfeiter" -header "${SCRIPT_ROOT}/hack/boilerplate.go.txt" -o pkg/controller/fakes/manager.go vendor/sigs.k8s.io/controller-runtime/pkg/manager Manager
GO111MODULE=off "${BIN}/counterfeiter" -header "${SCRIPT_ROOT}/hack/boilerplate.go.txt" -o pkg/controller/fakes/client.go vendor/sigs.k8s.io/controller-runtime/pkg/client Client
GO111MODULE=off "${BIN}/counterfeiter" -header "${SCRIPT_ROOT}/hack/boilerplate.go.txt" -o pkg/controller/fakes/status_writer.go vendor/sigs.k8s.io/controller-runtime/pkg/client StatusWriter
GO111MODULE=off counterfeiter -header "${SCRIPT_ROOT}/hack/boilerplate.go.txt" -o pkg/controller/fakes/manager.go vendor/sigs.k8s.io/controller-runtime/pkg/manager Manager
GO111MODULE=off counterfeiter -header "${SCRIPT_ROOT}/hack/boilerplate.go.txt" -o pkg/controller/fakes/client.go vendor/sigs.k8s.io/controller-runtime/pkg/client Client
GO111MODULE=off counterfeiter -header "${SCRIPT_ROOT}/hack/boilerplate.go.txt" -o pkg/controller/fakes/status_writer.go vendor/sigs.k8s.io/controller-runtime/pkg/client StatusWriter

0 comments on commit 6263f40

Please sign in to comment.