I am trying to compile the InfluxDB database (version v0.8.8) using go get github.com/influxdb/influxdb
But this pulls the master branch, and I need the
go mod
is available now.
For those who need to build a binary of a specific tag, here is my way:
mkdir temp
cd temp
go mod init .
go get -d -v github.com/nsqio/nsq@v1.1.0
mkdir bin
go build -o bin/nsqd.exe github.com/nsqio/nsq/apps/nsqd
Explanation:
nsqd
.go mod init .
creates a go.mod
file in the current directory, which enables using go get
with revision/tags. (see this link)-d
means "download only", if you want a direct installation, omit this flag and the build commands below this line.-v
means "be verbose".bin/nsqd.exe
with bin/nsqd
.The module downloaded is stored in %GOPATH%\pkg\mod
. If you don't want to pollute your GOPATH
directory, make a new one and set your GOPATH
to it.