Discord: Try to avoid more race conditions

also added RACE=on to Makefile to enable go's race detector.
This commit is contained in:
Harvey Tindall
2021-05-23 22:26:56 +01:00
parent f419a57e6d
commit 86ef665b12
2 changed files with 15 additions and 2 deletions
+8 -1
View File
@@ -52,6 +52,13 @@ else
TYPECHECK :=
endif
RACE ?= off
ifeq ($(RACE), on)
RACEDETECTOR := -race
else
RACEDETECTOR :=
endif
npm:
$(info installing npm dependencies)
npm install
@@ -91,7 +98,7 @@ compile:
$(GOBINARY) mod download
$(info Building)
mkdir -p build
$(GOBINARY) build -ldflags="$(LDFLAGS)" $(TAGS) -o build/jfa-go
$(GOBINARY) build $(RACEDETECTOR) -ldflags="$(LDFLAGS)" $(TAGS) -o build/jfa-go
compress:
upx --lzma build/jfa-go