use ldflag in makefile

This commit is contained in:
raziman 2020-09-05 17:06:23 +08:00
parent 7dd2a4f40e
commit a967c3d6e5
3 changed files with 2 additions and 3 deletions

View File

@ -31,7 +31,7 @@ $(INSTALL_DIR):
build: $(BIN_DIR)
@echo === BUILDING ===
${GO} build -v -o $(BIN_DIR)/$(BIN_NAME)
${GO} build -ldflags "-X main.VERSION=${VERSION}" -v -o $(BIN_DIR)/$(BIN_NAME)
install: build $(INSTALL_DIR)
@echo === INSTALLING ===

View File

@ -7,7 +7,7 @@ import (
"github.com/ztrue/tracerr"
)
const VERSION = "v1.5.5"
var VERSION = "N/A"
var gomu *Gomu

View File

@ -53,7 +53,6 @@ func debugLog(val ...interface{}) {
log.Println(val...)
}
// Formats duration to my desired output mm:ss
func fmtDuration(input time.Duration) string {