What are the differences between "go run", "go build" and "go install" and in which cases I should use them?
Asked
Active
Viewed 4,097 times
4
-
2What is unclear in the documentation you get from `go help run`, `go help build` and `go help install`? – Volker Jun 29 '16 at 08:09
-
@Volker I am not able to understand the usecase – Kumaran Jun 29 '16 at 12:08
-
6`go install` compiles packages and binaries and stores them in $GOPATH/pkg and $GOPATH/bin. `go build` builds packages and discards the result, for binaries it builds and keeps the executable. `go run` is a handy shortcut to build some code and run it directly. – Volker Jun 29 '16 at 12:13
-
Checkout all command official documentation on https://golang.org/cmd/go/ – Harsh Nagarkar Nov 27 '20 at 23:00