@@ -104,6 +104,8 @@ During a particular build, the following words are satisfied:
104
104
- "cgo", if ctxt.CgoEnabled is true
105
105
- "go1.1", from Go version 1.1 onward
106
106
- "go1.2", from Go version 1.2 onward
107
+ - "go1.3", from Go version 1.3 onward
108
+ - "go1.4", from Go version 1.4 onward
107
109
- any additional words listed in ctxt.BuildTags
108
110
109
111
If a file's name, after stripping the extension and a possible _ test suffix,
@@ -114,15 +116,10 @@ matches any of the following patterns:
114
116
*_GOARCH
115
117
*_GOOS_GOARCH
116
118
117
- (example: source_windows_amd64.go) or the literals:
118
-
119
-
120
- GOOS
121
- GOARCH
122
-
123
- (example: windows.go) where GOOS and GOARCH represent any known operating
124
- system and architecture values respectively, then the file is considered to
125
- have an implicit build constraint requiring those terms.
119
+ (example: source_windows_amd64.go) where GOOS and GOARCH represent
120
+ any known operating system and architecture values respectively, then
121
+ the file is considered to have an implicit build constraint requiring
122
+ those terms.
126
123
127
124
To keep a file from being considered for the build:
128
125
@@ -147,6 +144,9 @@ Naming a file dns_windows.go will cause it to be included only when
147
144
building the package for Windows; similarly, math_386.s will be included
148
145
only when building the package for 32-bit x86.
149
146
147
+ Using GOOS=android matches build tags and files as for GOOS=linux
148
+ in addition to android tags and files.
149
+
150
150
151
151
152
152
@@ -330,6 +330,12 @@ const (
330
330
// If AllowBinary is set, Import can be satisfied by a compiled
331
331
// package object without corresponding sources.
332
332
AllowBinary
333
+
334
+ // If ImportComment is set, parse import comments on package statements.
335
+ // Import returns an error if it finds a comment it cannot understand
336
+ // or finds conflicting comments in multiple source files.
337
+ // See golang.org/s/go14customimport for more information.
338
+ ImportComment
333
339
)
334
340
```
335
341
@@ -340,6 +346,33 @@ const (
340
346
341
347
342
348
349
+ ## type MultiplePackageError
350
+ ``` go
351
+ type MultiplePackageError struct {
352
+ Dir string // directory containing files
353
+ Packages []string // package names found
354
+ Files []string // corresponding files: Files[i] declares package Packages[i]
355
+ }
356
+ ```
357
+ MultiplePackageError describes a directory containing
358
+ multiple buildable Go source files for multiple packages.
359
+
360
+
361
+
362
+
363
+
364
+
365
+
366
+
367
+
368
+
369
+
370
+ ### func (\* MultiplePackageError) Error
371
+ ``` go
372
+ func (e *MultiplePackageError ) Error () string
373
+ ```
374
+
375
+
343
376
## type NoGoError
344
377
``` go
345
378
type NoGoError struct {
@@ -369,18 +402,19 @@ func (e *NoGoError) Error() string
369
402
## type Package
370
403
``` go
371
404
type Package struct {
372
- Dir string // directory containing package sources
373
- Name string // package name
374
- Doc string // documentation synopsis
375
- ImportPath string // import path of package ("" if unknown)
376
- Root string // root of Go tree where this package lives
377
- SrcRoot string // package source root directory ("" if unknown)
378
- PkgRoot string // package install root directory ("" if unknown)
379
- BinDir string // command install directory ("" if unknown)
380
- Goroot bool // package found in Go root
381
- PkgObj string // installed .a file
382
- AllTags []string // tags that can influence file selection in this directory
383
- ConflictDir string // this directory shadows Dir in $GOPATH
405
+ Dir string // directory containing package sources
406
+ Name string // package name
407
+ ImportComment string // path in import comment on package statement
408
+ Doc string // documentation synopsis
409
+ ImportPath string // import path of package ("" if unknown)
410
+ Root string // root of Go tree where this package lives
411
+ SrcRoot string // package source root directory ("" if unknown)
412
+ PkgRoot string // package install root directory ("" if unknown)
413
+ BinDir string // command install directory ("" if unknown)
414
+ Goroot bool // package found in Go root
415
+ PkgObj string // installed .a file
416
+ AllTags []string // tags that can influence file selection in this directory
417
+ ConflictDir string // this directory shadows Dir in $GOPATH
384
418
385
419
// Source files
386
420
GoFiles []string // .go source files (excluding CgoFiles, TestGoFiles, XTestGoFiles)
0 commit comments