-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new makefile targets for go mod verification
Run 'go mod' functions to search for tidy, vendor changes and verify it
- Loading branch information
Showing
3 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,9 @@ GATEKEEPER_VERSION = v3.10.0 | |
GATEKEEPER_IMAGE ?= ${RP_IMAGE_ACR}.azurecr.io/gatekeeper:$(GATEKEEPER_VERSION) | ||
GOTESTSUM = gotest.tools/[email protected] | ||
|
||
# Golang version go mod tidy compatibility | ||
GOLANG_VERSION ?= 1.20 | ||
|
||
ifneq ($(shell uname -s),Darwin) | ||
export CGO_CFLAGS=-Dgpgme_off_t=off_t | ||
endif | ||
|
@@ -275,9 +278,22 @@ admin.kubeconfig: | |
aks.kubeconfig: | ||
hack/get-admin-aks-kubeconfig.sh | ||
|
||
.PHONY: go-tidy | ||
go-tidy: # Run go mod tidy - add missing and remove unused modules. | ||
go mod tidy -compat=${GOLANG_VERSION} | ||
|
||
.PHONY: go-vendor | ||
go-vendor: # Run go mod vendor - only modules that are used in the source code will be vendored in (make vendored copy of dependencies). | ||
go mod vendor | ||
|
||
.PHONY: go-verify | ||
go-verify: go-tidy go-vendor # Run go mod verify - verify dependencies have expected content | ||
go mod verify | ||
|
||
vendor: | ||
# See comments in the script for background on why we need it | ||
hack/update-go-module-dependencies.sh | ||
$(MAKE) go-verify | ||
|
||
install-go-tools: | ||
go install ${GOTESTSUM} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,5 +41,3 @@ done | |
|
||
go get -u ./... | ||
|
||
go mod tidy -compat=1.20 | ||
go mod vendor |