The Go command builds binaries in a temporary directory. The go clean command was created in order to remove extraneous object files that are created by other tools or when go build is manually invoked. Go clean has a usage stanza of go clean [clean flags] [build flags] [packages].
The following flags are available for the clean command:
- The -cache flag removes the entire go build cache. This can be helpful if you're trying to compare a fresh build across multiple systems or if you'd like to see the amount of time a fresh build takes.
- The -i flag removes the archive or binary that go install creates.
- The -n flag is a noop; printing the result removes commands but doesn't execute them.
- The -r flag applies logic recursively to all the dependencies of the import path's packages.
- The -x flag prints and executes the...