From d8584d1ddbfcf19c5b1313c1beef0211180ff508 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Mon, 24 Feb 2020 12:55:59 -0500 Subject: [PATCH] Debug off using default "go build" Ref #1469 --- Makefile | 5 +++-- internal/util/util.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 4d536210..5583ba2b 100644 --- a/Makefile +++ b/Makefile @@ -8,14 +8,15 @@ DATE = $(shell GOOS=$(shell go env GOHOSTOS) GOARCH=$(shell go env GOHOSTARCH) \ ADDITIONAL_GO_LINKER_FLAGS = $(shell GOOS=$(shell go env GOHOSTOS) \ GOARCH=$(shell go env GOHOSTARCH)) GOBIN ?= $(shell go env GOPATH)/bin -GOVARS = -X github.com/zyedidia/micro/internal/util.Version=$(VERSION) -X github.com/zyedidia/micro/internal/util.CommitHash=$(HASH) -X 'github.com/zyedidia/micro/internal/util.CompileDate=$(DATE)' -X github.com/zyedidia/micro/internal/util.Debug=OFF +GOVARS = -X github.com/zyedidia/micro/internal/util.Version=$(VERSION) -X github.com/zyedidia/micro/internal/util.CommitHash=$(HASH) -X 'github.com/zyedidia/micro/internal/util.CompileDate=$(DATE)' +DEBUGVAR = -X github.com/zyedidia/micro/internal/util.Debug=ON # Builds micro after checking dependencies but without updating the runtime build: go build -ldflags "-s -w $(GOVARS) $(ADDITIONAL_GO_LINKER_FLAGS)" ./cmd/micro build-dbg: - go build -ldflags "-s -w $(ADDITIONAL_GO_LINKER_FLAGS)" ./cmd/micro + go build -ldflags "-s -w $(ADDITIONAL_GO_LINKER_FLAGS) $(DEBUGVAR)" ./cmd/micro build-tags: fetch-tags go build -ldflags "-s -w $(GOVARS) $(ADDITIONAL_GO_LINKER_FLAGS)" ./cmd/micro diff --git a/internal/util/util.go b/internal/util/util.go index 485d4f55..aebe8e17 100644 --- a/internal/util/util.go +++ b/internal/util/util.go @@ -30,7 +30,7 @@ var ( // CompileDate is the date this binary was compiled on CompileDate = "Unknown" // Debug logging - Debug = "ON" + Debug = "OFF" // FakeCursor is used to disable the terminal cursor and have micro // draw its own (enabled for windows consoles where the cursor is slow) FakeCursor = false