Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
eb5db57d
Commit
eb5db57d
authored
Mar 05, 2012
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/go: sync type Package and go list doc
R=golang-dev, bradfitz CC=golang-dev
https://golang.org/cl/5730061
parent
eb5af840
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
27 deletions
+39
-27
src/cmd/go/list.go
src/cmd/go/list.go
+23
-12
src/cmd/go/pkg.go
src/cmd/go/pkg.go
+16
-15
No files found.
src/cmd/go/list.go
View file @
eb5db57d
...
...
@@ -30,30 +30,41 @@ 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
ImportPath string // import path of package in dir
Dir string // directory containing package sources
Version string // version of installed package (TODO)
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, and XTestGoFiles)
TestGoFiles []string // _test.go source files internal to the package they are testing
XTestGoFiles []string // _test.go source files external to the package they are testing
CFiles []string // .c source files
HFiles []string // .h source files
SFiles []string // .s source files
CgoFiles []string // .go sources files that import "C"
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
// 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
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
}
The -json flag causes the package data to be printed in JSON format
...
...
src/cmd/go/pkg.go
View file @
eb5db57d
...
...
@@ -24,21 +24,18 @@ type Package struct {
// Note: These fields are part of the go command's public API.
// See list.go. It is okay to add fields, but not to change or
// remove existing ones. Keep in sync with list.go
Dir
string
`json:",omitempty"`
// directory containing package sources
ImportPath
string
`json:",omitempty"`
// import path of package in dir
Name
string
`json:",omitempty"`
// package name
Doc
string
`json:",omitempty"`
// package documentation string
Target
string
`json:",omitempty"`
// install path
Goroot
bool
`json:",omitempty"`
// is this package found in the Go root?
Standard
bool
`json:",omitempty"`
// is this package part of the standard Go library?
Stale
bool
`json:",omitempty"`
// would 'go install' do anything for this package?
Incomplete
bool
`json:",omitempty"`
// was there an error loading this package or dependencies?
Error
*
PackageError
`json:",omitempty"`
// error loading this package (not dependencies)
Root
string
`json:",omitempty"`
// root dir of tree this package belongs to
Dir
string
`json:",omitempty"`
// directory containing package sources
ImportPath
string
`json:",omitempty"`
// import path of package in dir
Name
string
`json:",omitempty"`
// package name
Doc
string
`json:",omitempty"`
// package documentation string
Target
string
`json:",omitempty"`
// install path
Goroot
bool
`json:",omitempty"`
// is this package found in the Go root?
Standard
bool
`json:",omitempty"`
// is this package part of the standard Go library?
Stale
bool
`json:",omitempty"`
// would 'go install' do anything for this package?
Root
string
`json:",omitempty"`
// Go root or Go path dir containing this package
// Source files
GoFiles
[]
string
`json:",omitempty"`
// .go source files (excluding CgoFiles, TestGoFiles XTestGoFiles)
GoFiles
[]
string
`json:",omitempty"`
// .go source files (excluding CgoFiles, TestGoFiles
,
XTestGoFiles)
CgoFiles
[]
string
`json:",omitempty"`
// .go sources files that import "C"
CFiles
[]
string
`json:",omitempty"`
// .c source files
HFiles
[]
string
`json:",omitempty"`
// .h source files
...
...
@@ -50,8 +47,12 @@ type Package struct {
CgoPkgConfig
[]
string
`json:",omitempty"`
// cgo: pkg-config names
// Dependency information
Imports
[]
string
`json:",omitempty"`
// import paths used by this package
Deps
[]
string
`json:",omitempty"`
// all (recursively) imported dependencies
Imports
[]
string
`json:",omitempty"`
// import paths used by this package
Deps
[]
string
`json:",omitempty"`
// all (recursively) imported dependencies
// Error information
Incomplete
bool
`json:",omitempty"`
// was there an error loading this package or dependencies?
Error
*
PackageError
`json:",omitempty"`
// error loading this package (not dependencies)
DepsErrors
[]
*
PackageError
`json:",omitempty"`
// errors loading dependencies
// Test information
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment