From 1795b5dec4d0b61461d74cf3ddfa931e78a8c804 Mon Sep 17 00:00:00 2001 From: Nicolas MASSE Date: Tue, 5 Jan 2021 14:26:38 +0100 Subject: [PATCH] fix project compilation on recent GO versions --- Makefile | 4 ++-- README.md | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ffa37f2..055ac92 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ buildNodeFrontend: cd web && rm build/static/**/*.map embedFrontend: - cd cmd/golang-url-shortener && packr2 --legacy + cd cmd/golang-url-shortener && packr2 getCMDDependencies: go get -v github.com/mattn/goveralls @@ -24,7 +24,7 @@ getGoDependencies: buildProject: rm -rf releases mkdir releases - gox -output="releases/{{.Dir}}_{{.OS}}_{{.Arch}}/{{.Dir}}" -osarch="linux/amd64 linux/arm windows/amd64 windows/386 darwin/amd64" -ldflags="-X github.com/mxschmitt/golang-url-shortener/internal/util.ldFlagNodeJS=`node --version` -X github.com/mxschmitt/golang-url-shortener/internal/util.ldFlagCommit=`git rev-parse HEAD` -X github.com/mxschmitt/golang-url-shortener/internal/util.ldFlagYarn=`yarn --version` -X github.com/mxschmitt/golang-url-shortener/internal/util.ldFlagCompilationTime=`TZ=UTC date +%Y-%m-%dT%H:%M:%S+0000`" ./cmd/golang-url-shortener + CGO_ENABLED=0 gox -output="releases/{{.Dir}}_{{.OS}}_{{.Arch}}/{{.Dir}}" -osarch="linux/amd64 linux/arm windows/amd64 windows/386 darwin/amd64" -ldflags="-X github.com/mxschmitt/golang-url-shortener/internal/util.ldFlagNodeJS=`node --version` -X github.com/mxschmitt/golang-url-shortener/internal/util.ldFlagCommit=`git rev-parse HEAD` -X github.com/mxschmitt/golang-url-shortener/internal/util.ldFlagYarn=`yarn --version` -X github.com/mxschmitt/golang-url-shortener/internal/util.ldFlagCompilationTime=`TZ=UTC date +%Y-%m-%dT%H:%M:%S+0000`" ./cmd/golang-url-shortener find releases -maxdepth 1 -mindepth 1 -type d -exec cp config/example.yaml {}/config.yaml \; find releases -maxdepth 1 -mindepth 1 -type d -exec tar -cvjf {}.tar.bz2 {} \; diff --git a/README.md b/README.md index 114d765..6758349 100644 --- a/README.md +++ b/README.md @@ -48,3 +48,16 @@ Only because I just want to extend my current self hosted URL shorter (which was - Travis CI - Key / Value databases - Dockerfile and Docker Image Creation + +## Compilation from Source + +```sh +test -n "$GOPATH" || echo "GOPATH is not set" +export GO111MODULE=auto +go get github.com/mxschmitt/golang-url-shortener +cd $GOPATH/src/github.com/mxschmitt/golang-url-shortener +git remote add mine git@github.com:nmasse-itix/golang-url-shortener.git +git pull mine master +make +``` +