Go Operations TO DELETE: Difference between revisions
No edit summary |
|||
Line 27: | Line 27: | ||
* https://golang.org/doc/gdb | * https://golang.org/doc/gdb | ||
=TODO= | |||
<font color=red> | |||
NOMBP2:bakm ovidiu$ go help get | |||
usage: go get [-d] [-f] [-fix] [-insecure] [-t] [-u] [build flags] [packages] | |||
Get downloads and installs the packages named by the import paths, | |||
along with their dependencies. | |||
The -d flag instructs get to stop after downloading the packages; that is, | |||
it instructs get not to install the packages. | |||
The -f flag, valid only when -u is set, forces get -u not to verify that | |||
each package has been checked out from the source control repository | |||
implied by its import path. This can be useful if the source is a local fork | |||
of the original. | |||
The -fix flag instructs get to run the fix tool on the downloaded packages | |||
before resolving dependencies or building the code. | |||
The -insecure flag permits fetching from repositories and resolving | |||
custom domains using insecure schemes such as HTTP. Use with caution. | |||
The -t flag instructs get to also download the packages required to build | |||
the tests for the specified packages. | |||
The -u flag instructs get to use the network to update the named packages | |||
and their dependencies. By default, get uses the network to check out | |||
missing packages but does not use it to look for updates to existing packages. | |||
Get also accepts build flags to control the installation. See 'go help build'. | |||
When checking out a new package, get creates the target directory | |||
GOPATH/src/<import-path>. If the GOPATH contains multiple entries, | |||
get uses the first one. See 'go help gopath'. | |||
When checking out or updating a package, get looks for a branch or tag | |||
that matches the locally installed version of Go. The most important | |||
rule is that if the local installation is running version "go1", get | |||
searches for a branch or tag named "go1". If no such version exists it | |||
retrieves the most recent version of the package. | |||
Unless vendoring support is disabled (see 'go help gopath'), | |||
when go get checks out or updates a Git repository, | |||
it also updates any git submodules referenced by the repository. | |||
Get never checks out or updates code stored in vendor directories. | |||
For more about specifying packages, see 'go help packages'. | |||
For more about how 'go get' finds source code to | |||
download, see 'go help importpath'. | |||
See also: go build, go install, go clean. | |||
</font> |
Revision as of 08:03, 4 April 2016
Internal
Subjects
Remote Imports
Go has build in support for fetching source code from remote repositories.
The import path can be used by Go tooling to determine where the code is on the network.
For an import statement similar to:
import "github.com/something/somethingelse"
go build will first search the local directories listed in GOPATH. If the package is found, the search stops. However, if using go get, the package (and its dependencies) is recursively fetched and placed in GOPATH.
Portability
Debugging
TODO
NOMBP2:bakm ovidiu$ go help get usage: go get [-d] [-f] [-fix] [-insecure] [-t] [-u] [build flags] [packages]
Get downloads and installs the packages named by the import paths, along with their dependencies.
The -d flag instructs get to stop after downloading the packages; that is, it instructs get not to install the packages.
The -f flag, valid only when -u is set, forces get -u not to verify that each package has been checked out from the source control repository implied by its import path. This can be useful if the source is a local fork of the original.
The -fix flag instructs get to run the fix tool on the downloaded packages before resolving dependencies or building the code.
The -insecure flag permits fetching from repositories and resolving custom domains using insecure schemes such as HTTP. Use with caution.
The -t flag instructs get to also download the packages required to build the tests for the specified packages.
The -u flag instructs get to use the network to update the named packages and their dependencies. By default, get uses the network to check out missing packages but does not use it to look for updates to existing packages.
Get also accepts build flags to control the installation. See 'go help build'.
When checking out a new package, get creates the target directory GOPATH/src/<import-path>. If the GOPATH contains multiple entries, get uses the first one. See 'go help gopath'.
When checking out or updating a package, get looks for a branch or tag that matches the locally installed version of Go. The most important rule is that if the local installation is running version "go1", get searches for a branch or tag named "go1". If no such version exists it retrieves the most recent version of the package.
Unless vendoring support is disabled (see 'go help gopath'), when go get checks out or updates a Git repository, it also updates any git submodules referenced by the repository.
Get never checks out or updates code stored in vendor directories.
For more about specifying packages, see 'go help packages'.
For more about how 'go get' finds source code to download, see 'go help importpath'.
See also: go build, go install, go clean.