diff --git a/Makefile b/Makefile index 20f0d6e3a..14115af7f 100644 --- a/Makefile +++ b/Makefile @@ -52,3 +52,8 @@ clean-lint-cache: build-examples: for example in $(shell find ./examples -mindepth 1 -maxdepth 1 -type d); do \ (cd $$example; echo Build $$example; go mod tidy; go build -o /dev/null) || exit 1; done + +.PHONY: add-go-work +add-go-work: + go work init . + go work use -r . diff --git a/examples/Makefile b/examples/Makefile index ddcc47d98..51a1cc6b5 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -4,14 +4,6 @@ SYNC_REF?=main sync: ## Sync all go.mod files @sh .update-all-to-latest.sh ${SYNC_REF} -.PHONY: add-go-work-files -add-go-work-files: ## Add go work files to all examples - find . -name go.mod -execdir sh -c 'go work init && go work use . && go work use ../..' \; - -.PHONY: rm-go-work-files -rm-go-work-files: ## Add go work files to all examples - rm -f ./*/go.work* - .PHONY: install-all install-all: ## Add go work files to all examples @find . -name go.mod -execdir go install \;