From 9af10d9d9401f4e107e433bd6a6d142d863440d1 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 3 Nov 2021 02:51:41 -0500 Subject: [PATCH] GOMOD: learning go.mod finally Signed-off-by: Jeff Carr --- Makefile | 13 ++++++++++++- go.mod | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 71e9db5..e1898cc 100644 --- a/Makefile +++ b/Makefile @@ -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} \ diff --git a/go.mod b/go.mod index 231f8c5..dc6565f 100644 --- a/go.mod +++ b/go.mod @@ -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