Questions tagged [goinstall]
19 questions
66
votes
8 answers
Golang equivalent of npm install -g
If I had a compiled Golang program that I wanted to install such that I could run it with a bash command from anywhere on my computer, how would I do that? For example, in nodejs
npm install -g express
Installs express such that I can run the…

Ryan
- 1,131
- 3
- 13
- 17
10
votes
1 answer
Why Go Programs need runtime support
It's said that Golang is the compiled language, but what does it mean by compiled? If golang application is compiled to machine code, why can't I just distribute the binary (of course on corresponding arch and platform) instead of go install stuff?

qweruiop
- 3,156
- 6
- 31
- 55
3
votes
3 answers
unable to run goinstall
goinstall go-tour.googlecode.com/hg/gotour
Running the above command give me the following message ..
goinstall: encoding/json: go/build: package could not be found locally
goinstall: code.google.com/p/go-tour/pic: cannot download:…

sakthig
- 2,187
- 3
- 18
- 22
2
votes
1 answer
go install on windows: "Access is Denied"
I am new to programming in Go. I would really like your help regarding one of my problems.
I am required to do go install on a file, the executable of which (in Windows) is created in a folder called GOPATH\bin.
Until now, I typically followed the…

progfan
- 2,454
- 3
- 22
- 28
1
vote
1 answer
how to `go install` from gitea
I'm trying to install a package from a self-hosted gitea instance. I'm trying to get a package running go install gitea.urkob.com/urko/go-root-dir but I'm getting this error
no required module provides package gitea.urkob.com/urko/go-root-dir; to…

Gudari
- 287
- 1
- 16
1
vote
2 answers
Update go using go install
How can the existing version of go be updated using the go install command?
I've done the following
$ go install golang.org/dl/go1.19.4@latest
go: downloading golang.org/dl v0.0.0-20221207214018-bd7282711064
$ go1.19.4 download
Downloaded 0.0% ( …

gameveloster
- 901
- 1
- 6
- 18
1
vote
2 answers
can't find import go-gtk
I've been playing around with Google Go, I love the power behind it and decided to try out some libraries. I tried using goinstall to install github.com/mattn/go-gtk/gtk but when I try to compile an example I'm getting:
can't find import:…

Isaiah
- 1,995
- 2
- 18
- 29
1
vote
2 answers
Compiling CGO files in Golang package
I am trying to use CGO to bundle C files with a Golang package. Following instructions here:
https://karthikkaranth.me/blog/calling-c-code-from-go/
http://akrennmair.github.io/golang-cgo-slides/#1
https://golang.org/cmd/cgo/
I am getting this…

Alexander Mills
- 90,741
- 139
- 482
- 817
1
vote
1 answer
Including pkg in .dockerignore file
Right now my .dockerignore file has this contents:
.vscode
.idea
.git
bin
pkg
and my Dockerfile looks like:
FROM golang:latest
RUN mkdir -p /app
WORKDIR /app
COPY . .
ENV GOPATH /app
RUN go install huru
EXPOSE 3000
ENTRYPOINT /app/bin/huru
My…

Alexander Mills
- 90,741
- 139
- 482
- 817
1
vote
1 answer
$GOPATH is set but go install does not work
I am trying to understand the go environment, but I can't seem to go install any package I git cloned locally. go install on the hello world example works fine.
~GOPATH/src/go-github(master ✔) go install -i…

sizzle
- 2,883
- 2
- 13
- 10
1
vote
2 answers
Import web.go error after using goinstall
With halfdans advice, I was successfully able to use goinstall github.com/hoisie/web.go without any errors after installing git first. However, now when I try to compile the sample code given, go is not finding the web package. I get the…

Metropolis
- 6,542
- 19
- 56
- 86
1
vote
2 answers
web.go install error
I am trying to install web.go using goinstall github.com/hoisie/web.go, and I keep getting an error about the path.
goinstall: github.com/hoisie/web.go: git: no such file or directory
goinstall is working for sure because when I type in just…

Metropolis
- 6,542
- 19
- 56
- 86
0
votes
2 answers
Go install error: ambiguous import: found github.com/hashicorp/consul/api in multiple modules
I'm trying to install Levant but I'm getting the error:
go install github.com/hashicorp/levant
build github.com/hashicorp/levant: cannot load github.com/hashicorp/consul/api: ambiguous import: found github.com/hashicorp/consul/api in multiple…

milenao
- 707
- 1
- 6
- 8
0
votes
2 answers
Why doesn't `go env` command reflect change in environment variable?
In my system, GOBIN variable was unset (empty value). Now unlike some other GO env variables, this seems unset even in the output for go env command. (I'm user ubuntu, so ~ is /home/ubuntu/)
echo $GOBIN
//empty
echo $GOPATH
//empty
echo…

Ambareesh
- 324
- 1
- 4
- 18
0
votes
1 answer
Force `go get` and `go install` to use cache even if it's ancient
Is there a flag for go get or go install to force those to use the cache, even if the cache is very old / ancient? We are using docker images / multi-stage build to cache deps, and those original files might be weeks or months old.
user12374570