From d50fb6cf7502abfedf6b8b5f2f7e0204bd8a26e8 Mon Sep 17 00:00:00 2001 From: Jont828 Date: Tue, 15 Aug 2023 16:22:06 -0400 Subject: [PATCH] Pass ldflags in to air.toml and go-run make target --- .air.toml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.air.toml b/.air.toml index a19bce8..dd4cfc7 100644 --- a/.air.toml +++ b/.air.toml @@ -3,7 +3,7 @@ tmp_dir = "tmp" [build] bin = "./tmp/main" - cmd = "go build -o ./tmp/main ." + cmd = "make build-go GO_BIN_OUT=./tmp/main" delay = 1000 exclude_dir = ["assets", "tmp", "vendor", "web/node_modules"] exclude_file = [] diff --git a/Makefile b/Makefile index a6c24e0..05f6210 100644 --- a/Makefile +++ b/Makefile @@ -68,7 +68,7 @@ run: $(GO_BIN_OUT) $(DIST_FOLDER) .PHONY: go-run go-run: $(DIST_FOLDER) - go run main.go + go run -ldflags "$(LDFLAGS)" main.go .PHONY: air air: .air.toml