From 504c05ba6cf3eba4f6e1a0c1cbaa2f9fd4605a39 Mon Sep 17 00:00:00 2001 From: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com> Date: Thu, 19 Sep 2024 14:16:30 -0400 Subject: [PATCH] Add `-mod=readonly` to build Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 68c9e4b..c410c2f 100644 --- a/Makefile +++ b/Makefile @@ -72,7 +72,7 @@ build-release: fi @for OS in linux darwin windows; do for ARCH in amd64 arm64; do \ echo "# Building $${OS}-$${ARCH}-PolicyGenerator"; \ - GOOS=$${OS} GOARCH=$${ARCH} CGO_ENABLED=0 go build -ldflags="$(GO_LDFLAGS)" -o build_output/$${OS}-$${ARCH}-PolicyGenerator ./cmd/PolicyGenerator; \ + GOOS=$${OS} GOARCH=$${ARCH} CGO_ENABLED=0 go build -mod=readonly -ldflags="$(GO_LDFLAGS)" -o build_output/$${OS}-$${ARCH}-PolicyGenerator ./cmd/PolicyGenerator; \ done; done # Adding .exe extension to Windows binaries @for FILE in $$(ls -1 build_output/windows-* | grep -v ".exe$$"); do \