GOMOD: learning go.mod finally

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2021-11-03 02:51:41 -05:00
parent e7042580fc
commit 9af10d9d94
2 changed files with 14 additions and 1 deletions

View File

@ -5,9 +5,20 @@ VERSION = $(shell cat resources/VERSION)
# PATH=/usr/bin:$PATH go version
run: build
run: new-build
~/go/bin/wit-debian-gui
new-build:
go mod edit -replace git.wit.org/wit/gui=/home/jcarr/go/src/git.wit.org/wit/gui
# to update go.mod to master:
# go get git.wit.org/wit/gui@master
go install -ldflags " \
-X main.GITCOMMIT=${GITCOMMIT} \
-X main.GOVERSION='${GOVERSION}' \
-X main.BUILDTIME='${BUILDTIME}' \
-X main.VERSION=${VERSION}"
# to build the old way
build:
GO111MODULE="off" go install -ldflags " \
-X main.GITCOMMIT=${GITCOMMIT} \

2
go.mod
View File

@ -42,3 +42,5 @@ require (
golang.org/x/sys v0.0.0-20211031064116-611d5d643895 // indirect
golang.org/x/text v0.3.6 // indirect
)
replace git.wit.org/wit/gui => /home/jcarr/go/src/git.wit.org/wit/gui