# What Does Go Build Build?

## Metadata
- Author: [[stackoverflow.com]]
- Full Title: What Does Go Build Build?
- Category: #articles
- Summary: The `go build` command compiles packages but discards the results, while `go install` compiles and installs them in the appropriate directories. For the "main" package, `go build` places the executable in the current directory, and `go install` moves it to `$GOPATH/bin`. Additionally, using modules changes how dependencies are handled, with `go install` also installing required dependencies automatically.
- URL: https://stackoverflow.com/questions/30612611/what-does-go-build-build-go-build-vs-go-install
## Highlights
- **For commands (package `main`)**
• `go build` builds the command and leaves the result in the *current working directory*.
• `go install` builds the command in a temporary directory then moves it to `$GOPATH/bin`. ([View Highlight](https://read.readwise.io/read/01jvt9n2t97yxk7cey6q35qy3a))