Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

go-packages(7) [bsd man page]

GO-PACKAGES(7)						 Miscellaneous Information Manual					    GO-PACKAGES(7)

NAME
go - tool for managing Go source code DESCRIPTION
Many commands apply to a set of packages: go action [packages] Usually, [packages] is a list of import paths. An import path that is a rooted path or that begins with a . or .. element is interpreted as a file system path and denotes the package in that directory. Otherwise, the import path P denotes the package found in the directory DIR/src/P for some DIR listed in the GOPATH environment variable (see 'go help gopath'). If no import paths are given, the action applies to the package in the current directory. The special import path "all" expands to all package directories found in all the GOPATH trees. For example, 'go list all' lists all the packages on the local system. The special import path "std" is like all but expands to just the packages in the standard Go library. An import path is a pattern if it includes one or more "..." wildcards, each of which can match any string, including the empty string and strings containing slashes. Such a pattern expands to all package directories found in the GOPATH trees with names matching the patterns. As a special case, x/... matches x as well as x's subdirectories. For example, net/... expands to net and packages in its subdirectories. An import path can also name a package to be downloaded from a remote repository. Run 'go help remote' for details. Every package in a program must have a unique import path. By convention, this is arranged by starting each path with a unique prefix that belongs to you. For example, paths used internally at Google all begin with 'google', and paths denoting remote repositories begin with the path to the code, such as 'code.google.com/p/project'. As a special case, if the package list is a list of .go files from a single directory, the command is applied to a single synthesized pack- age made up of exactly those files, ignoring any build constraints in those files and ignoring any other files in the directory. AUTHOR
This manual page was written by Michael Stapelberg <stapelberg@debian.org>, for the Debian project (and may be used by others). 2012-05-13 GO-PACKAGES(7)

Check Out this Related Man Page

GO-LIST(1)						      General Commands Manual							GO-LIST(1)

NAME
go - tool for managing Go source code SYNOPSIS
go list [-e] [-f format] [-json] [ packages ] DESCRIPTION
List lists the packages named by the import paths, one per line. The default output shows the package import path: code.google.com/p/google-api-go-client/books/v1 code.google.com/p/goauth2/oauth code.google.com/p/sqlite OPTIONS
-f The -f flag specifies an alternate format for the list, using the syntax of package template. The default output is equivalent to -f '{{.ImportPath}}'. The struct being passed to the template is: type Package struct { Dir string // directory containing package sources ImportPath string // import path of package in dir Name string // package name Doc string // package documentation string Target string // install path Goroot bool // is this package in the Go root? Standard bool // is this package part of the standard Go library? Stale bool // would 'go install' do anything for this package? Root string // Go root or Go path dir containing this package // Source files GoFiles []string // .go source files (excluding CgoFiles, TestGoFiles, XTestGoFiles) CgoFiles []string // .go sources files that import "C" CFiles []string // .c source files HFiles []string // .h source files SFiles []string // .s source files SysoFiles []string // .syso object files to add to archive // Cgo directives CgoCFLAGS []string // cgo: flags for C compiler CgoLDFLAGS []string // cgo: flags for linker CgoPkgConfig []string // cgo: pkg-config names // Dependency information Imports []string // import paths used by this package Deps []string // all (recursively) imported dependencies // Error information Incomplete bool // this package or a dependency has an error Error *PackageError // error loading package DepsErrors []*PackageError // errors loading dependencies TestGoFiles []string // _test.go files in package TestImports []string // imports from TestGoFiles XTestGoFiles []string // _test.go files outside package XTestImports []string // imports from XTestGoFiles } -json The -json flag causes the package data to be printed in JSON format instead of using the template format. -e The -e flag changes the handling of erroneous packages, those that cannot be found or are malformed. By default, the list command prints an error to standard error for each erroneous package and omits the packages from consideration during the usual printing. With the -e flag, the list command never prints errors to standard error and instead processes the erroneous packages with the usual printing. Erroneous packages will have a non-empty ImportPath and a non-nil Error field; other information may or may not be miss- ing (zeroed). For more about specifying packages, see go-packages(7). AUTHOR
This manual page was written by Michael Stapelberg <stapelberg@debian.org>, for the Debian project (and may be used by others). 2012-05-13 GO-LIST(1)
Man Page