Skip to content

Instantly share code, notes, and snippets.

@JohnnyNiu
Last active February 16, 2021 09:34
Show Gist options
  • Save JohnnyNiu/45917644696b40c7678c07c7b7a690f7 to your computer and use it in GitHub Desktop.
Save JohnnyNiu/45917644696b40c7678c07c7b7a690f7 to your computer and use it in GitHub Desktop.
Difference between `go build` and 'go install`

go build compile and build executable and move it to the destination where you run the command

go install compile and move executable to $GOBIN directory, and cache all non-main packages which imported for the package you installed, it will be used in your next compile if not changed yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment