diff --git a/Makefile b/Makefile index 3b52188..99be127 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ all: bin/example test: lint unit-test PLATFORM=local +UTIL_TAG=1.16.5-alpine .PHONY: bin/example bin/example: @@ -22,3 +23,11 @@ unit-test-coverage: .PHONY: lint lint: @docker build . --target lint + +.PHONY: tidy +tidy: + @docker run -t -i -v `pwd`:/src --workdir /src --rm golang:${UTIL_TAG} /usr/local/go/bin/go mod tidy + +.PHONY: init +init: + @docker run -t -i -v `pwd`:/src --workdir /src --rm golang:${UTIL_TAG} /usr/local/go/bin/go mod init diff --git a/README.md b/README.md index 63fdf52..ddfdf95 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,9 @@ The [Makefile](./Makefile) is purely used to script the required `docker build` commands as these can get quite long. You can replace this file with a scripting language of your choice. +Additional targets 'init' and 'tidy' are provided for updating the project +metadata in go.mod and go.sums. `make tidy` should be run whenever new requirements are added. + ### CI The CI is configured in the [ci.yaml file](./.github/workflows/ci.yaml). By