Go-get downloads the packages named by the import paths, along with their dependencies. It then installs the named packages, like 'go install'.
Questions tagged [go-get]
80 questions
0
votes
1 answer
go get returns go: flag needs an argument: -mod
I have updated my go version from go1.12.4 to go1.13.4. I have created a project and initialized it with go mod init myproject creating a go.mod file with the information:
module myproject
go 1.13
When I try to download a dependency
go get…

Víctor M
- 307
- 4
- 16
0
votes
1 answer
How to distinct what dependencies are downloadable?
I use this code to get a list of dependencies imported in a single Go source file:
// GetFileImports returns all the imports from the Golang source code file.
func GetFileImports(filepath string) ([]string, error) {
fset := token.NewFileSet()
…

zergon321
- 210
- 1
- 10
0
votes
1 answer
Does go-get run builds forked from current shell process with different environment variables?
I have a simple Makefile like this:
unexport GOPATH
help :
@echo "libedkafka"
@echo "libedkafka-clean"
opt/librdkafka:
(mkdir -p ./opt && cd ./opt && git clone…

Reza Same'ei
- 819
- 8
- 22
0
votes
1 answer
Why does Go-get ask me to pick a branch?
I want to install mongoDB-driver. When I type this command
go get go.mongodb.org/mongo-driver/mongo
I got :
# cd /Users/jiangwei/go/src/go.mongodb.org/mongo-driver; git pull --ff-only
There is no tracking information for the current…

Jinnrry
- 405
- 1
- 5
- 18
0
votes
0 answers
Bitbucket Cloud `go get` support?
I want to use go get with a project hosted on private Bitbucket cloud. I have ssh configured so that the following works without manually entering credentials:
git clone git@bitbucket.org:/.git
The following attempts don't…

clay
- 18,138
- 28
- 107
- 192
0
votes
0 answers
How to use go-get to get nested project structure
I have a github structure like :
group_name/Project_dir/Project_subdir which looks like this git@github.com:group_name/project_dir/subdir.git on github . I'm trying to use go-get to get the project but it treats go get…

abhishek627
- 138
- 2
- 10
0
votes
0 answers
Is there a way to make a Go app with a Makefile to be "go gettable"?
I have a few projects in Go that contain a Makefile to perform various tasks to build, install, create assets, run generators etc. Is there a way to make such programs "go gettable", or I have to figure out a way to substitute Makefile with…

dimus
- 8,712
- 10
- 45
- 56
0
votes
3 answers
go get installation from a local fork
I am trying to install a go package from a local directory (basically I checked out and existing package and applied a pending pull request).
$ # Both commands give a similar output
$ go get -u file:///Users/me/workspaces/go/somepackage
$ go get -u…

AsTeR
- 7,247
- 14
- 60
- 99
0
votes
0 answers
Not able to build coredns project because of failure to fetch a dependency
I tried to build coredns https://github.com/coredns/coredns/ by cloning the repo in my gopath and running make, which produced the following error
GO111MODULE=on go generate coredns.go
GO111MODULE=on CGO_ENABLED=0 go build -v -ldflags="-s -w -X…

Palash Nigam
- 1,653
- 3
- 14
- 26
0
votes
1 answer
go get: Git settings are ignored
I try to go get a repository from a private gitlab server, from a mac.
I set the git config (~/.gitconfig) to use ssh instead of https :
[url "git@gitlab.mysite.com:"]
insteadOf = https://gitlab.mysite.com/
When I clone the project using the…

BlueMagma
- 2,392
- 1
- 22
- 46
-1
votes
1 answer
Golang's go get and install commands fail with "405 Not allowd" errors from gocenter.io
I came back to golang after a while, and tried to troubleshoot an open source library.
When I tried to install its dependencies, and even when my IDE (VSCode) tried to install the current language server, I would get errors like the following:
$ go…

MasterAM
- 16,283
- 6
- 45
- 66
-1
votes
1 answer
Not able to import private gitlab repository
I am trying to import a private gitlab repository into my Go code.
I want to use the user access token for authentication. Is there a way in which I could pass the access token in the import command.
I tried using the basic oauth2 url in the import…

AS-Sher
- 384
- 1
- 4
- 18
-2
votes
1 answer
What is the -v switch in go get -u -v
According to documentation
Usage:
go get [-d] [-t] [-u] [-v] [build flags] [packages]
The text explain every switch, but -v is missing from docs.
go help get also doesn't mention -v, although it is clearly present in usage:
$ go help get
usage:…

natenho
- 5,231
- 4
- 27
- 52
-2
votes
3 answers
Downloading Go Packages
I cloned a project from Github and before starting to work I have to install all the dependencies listed in the go.mod file.
I can do it one my one using the go get command, but is there any other alternative to this.
Something like npm i and it…

Om Gupta
- 192
- 2
- 8
-2
votes
1 answer
'go get' unexpected behavior on docker container
I'm having an unexpected behavior when running go get [module] inside a docker container compared to my local machine and I will appreciate any help to understand the reason for this different behavior.
1) Local machine
Command:
go get…

fdaines
- 1,216
- 10
- 12