Skip to content

Commit 94916dc

Browse files
committed
fix(make): fix empty GOPATH case
1 parent 0721a2f commit 94916dc

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,22 @@ ifeq ($(OS),Windows_NT)
1313
PATHSEP=;
1414
FOLDERSEP=\\
1515
EXTENSION=.exe
16+
# case gopath is empty used the default one
17+
ifeq ($(GOPATH),)
18+
GOPATH=$(USERPROFILE)\go
19+
endif
1620
else
1721
PATHSEP=:
1822
FOLDERSEP=/
1923
EXTENSION=""
24+
# case gopath is empty used the default one
25+
ifeq ($(GOPATH),)
26+
GOPATH=$(HOME)/go
27+
endif
2028
endif
2129

22-
# go env vars
2330
GO=$(firstword $(subst $(PATHSEP), ,$(GOPATH)))
31+
2432
# list of pkgs for the project without vendor
2533
PKGS=$(shell go list ./... | grep -v /vendor/)
2634
DOCKER_IP=$(shell if [ -z "$(DOCKER_MACHINE_NAME)" ]; then echo 'localhost'; else docker-machine ip $(DOCKER_MACHINE_NAME); fi)

todolist.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ func main() {
7878
Usage: "Set the database migration folder path",
7979
Destination: &migrationPath,
8080
},
81-
8281
cli.StringFlag{
8382
Value: logLevel,
8483
Name: "logl, l",

0 commit comments

Comments
 (0)