The issues with package versioning and dependency management are well known and frequently discussed in the Go community. This article does not cover new ground in that discussion.
To list the dependencies for the application github.com/user/myapp, run the command:
go list -f '{{.Deps}}' github.com/user/myapp
The command go build github.com/mypackage
builds github.com/mypackage and its dependencies. If github.com/mypackage is a command (a package with name 'main'), then the resulting binary is written to the current working directory. If github.com/mypackage is not a command, then you probably want go install github.com/mypackage
This command builds and installs the package.