From f7303e8197b31849152bc2bf463c57f9028ec67c Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Mon, 2 May 2022 14:00:47 -0500 Subject: [PATCH] go: Fix build; move to modern go install cmd --- Dockerfile | 2 +- Makefile | 10 +++++----- go.mod | 5 +++++ go.sum | 5 +++++ 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9fc22b42..21b57742 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ COPY assets/ ./assets/ RUN npm install && NODE_ENV=production ./node_modules/gulp/bin/gulp.js FROM golang:latest AS binarybuilder -RUN go get -u github.com/gobuffalo/packr/packr +RUN go install github.com/gobuffalo/packr/packr@latest WORKDIR /go/src/github.com/usefathom/fathom COPY . /go/src/github.com/usefathom/fathom COPY --from=assetbuilder /app/assets/build ./assets/build diff --git a/Makefile b/Makefile index 51cf2c93..566899b7 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,11 @@ $(EXECUTABLE): $(GO_SOURCES) assets/build go build -o $@ $(MAIN_PKG) .PHONY: docker -docker: $(GO_SOURCES) +docker: $(GO_SOURCES) $(GOPATH)/bin/packr GOOS=linux GOARCH=amd64 $(GOPATH)/bin/packr build -v -ldflags '-w $(LDFLAGS)' -o $(EXECUTABLE) $(MAIN_PKG) $(GOPATH)/bin/packr: - GOBIN=$(GOPATH)/bin go get -u github.com/gobuffalo/packr/packr + GOBIN=$(GOPATH)/bin go install github.com/gobuffalo/packr/packr@latest .PHONY: npm npm: @@ -35,7 +35,7 @@ assets/dist: $(ASSET_SOURCES) npm .PHONY: clean clean: go clean -i ./... - packr clean + $(GOPATH)/bin/packr clean rm -rf $(EXECUTABLE) .PHONY: fmt @@ -49,14 +49,14 @@ vet: .PHONY: errcheck errcheck: @which errcheck > /dev/null; if [ $$? -ne 0 ]; then \ - go get -u github.com/kisielk/errcheck; \ + go install github.com/kisielk/errcheck@latest; \ fi errcheck $(PACKAGES) .PHONY: lint lint: @which golint > /dev/null; if [ $$? -ne 0 ]; then \ - go get -u github.com/golang/lint/golint; \ + go install github.com/golang/lint/golint@latest; \ fi for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done; diff --git a/go.mod b/go.mod index e990e756..927e0a65 100644 --- a/go.mod +++ b/go.mod @@ -23,8 +23,13 @@ require ( require ( github.com/gorilla/securecookie v1.1.2-0.20180608144417-78f3d318a8bf // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/pkg/errors v0.8.1-0.20180311214515-816c9085562c // indirect + github.com/spf13/cobra v0.0.3 // indirect + github.com/spf13/pflag v1.0.2 // indirect github.com/ziutek/mymysql v1.5.5-0.20171217234033-ff6cc86d3d93 // indirect + golang.org/x/net v0.0.0-20180921000356-2f5d2388922f // indirect + golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f // indirect golang.org/x/sys v0.0.0-20180724212812-e072cadbbdc8 // indirect google.golang.org/appengine v1.1.0 // indirect gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect diff --git a/go.sum b/go.sum index 5242a225..523f8bcb 100644 --- a/go.sum +++ b/go.sum @@ -16,6 +16,7 @@ github.com/gorilla/securecookie v1.1.2-0.20180608144417-78f3d318a8bf h1:tgJ+TrHb github.com/gorilla/securecookie v1.1.2-0.20180608144417-78f3d318a8bf/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/sessions v1.1.1 h1:YMDmfaK68mUixINzY/XjscuJ47uXFWSSHzFbBQM0PrE= github.com/gorilla/sessions v1.1.1/go.mod h1:8KCfur6+4Mqcc6S0FEfKuN15Vl5MgXW92AE8ovaJD0w= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jmoiron/sqlx v1.2.1-0.20181024163419-82935fac6c1a h1:7F1aETmIWwSQAv4S2415VrWj9eJyxR3epEEb6O5isgA= github.com/jmoiron/sqlx v1.2.1-0.20181024163419-82935fac6c1a/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= @@ -47,7 +48,9 @@ github.com/rubenv/sql-migrate v0.0.0-20180704111356-3f452fc0ebeb h1:lAOy8O8yKU3u github.com/rubenv/sql-migrate v0.0.0-20180704111356-3f452fc0ebeb/go.mod h1:WS0rl9eEliYI8DPnr3TOwz4439pay+qNgzJoVya/DmY= github.com/sirupsen/logrus v1.0.7-0.20180723115307-c108f5553c36 h1:NvBdWUXstAlJwU7RjOTudVgMj5N/NTYKJxwoJN5+0XY= github.com/sirupsen/logrus v1.0.7-0.20180723115307-c108f5553c36/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= +github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v1.0.2 h1:Fy0orTDgHdbnzHcsOgfCN4LtHf0ec3wwtiwJqwvf3Gc= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -57,7 +60,9 @@ github.com/ziutek/mymysql v1.5.5-0.20171217234033-ff6cc86d3d93 h1:neEPpeeJDl7Rs0 github.com/ziutek/mymysql v1.5.5-0.20171217234033-ff6cc86d3d93/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= golang.org/x/crypto v0.0.0-20180723164146-c126467f60eb h1:Ah9YqXLj6fEgeKqcmBuLCbAsrF3ScD7dJ/bYM0C6tXI= golang.org/x/crypto v0.0.0-20180723164146-c126467f60eb/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/net v0.0.0-20180921000356-2f5d2388922f h1:QM2QVxvDoW9PFSPp/zy9FgxJLfaWTZlS61KEPtBwacM= golang.org/x/net v0.0.0-20180921000356-2f5d2388922f/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180724212812-e072cadbbdc8 h1:7T3bTJEttnfJdEY+NY/VYT7IXRaul8potWiyw/n7LB8= golang.org/x/sys v0.0.0-20180724212812-e072cadbbdc8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=