@@ -155,27 +155,29 @@ only when building the package for 32-bit x86.
155
155
``` go
156
156
var ToolDir = filepath.Join (runtime.GOROOT (), " pkg/tool/" +runtime.GOOS +" _" +runtime.GOARCH )
157
157
```
158
-
159
158
ToolDir is the directory containing build tools.
160
159
161
160
162
161
## func ArchChar
163
- <pre >func ArchChar(goarch string) (string, error)</pre >
162
+ ``` go
163
+ func ArchChar (goarch string ) (string , error )
164
+ ```
164
165
ArchChar returns the architecture character for the given goarch.
165
166
For example, ArchChar("amd64") returns "6".
166
167
167
168
168
-
169
169
## func IsLocalImport
170
- <pre >func IsLocalImport(path string) bool</pre >
170
+ ``` go
171
+ func IsLocalImport(path string) bool
172
+ ```
171
173
IsLocalImport reports whether the import path is
172
174
a local import path, like ".", "..", "./foo", or "../foo".
173
175
174
176
175
177
176
-
177
178
## type Context
178
- <pre >type Context struct {
179
+ ``` go
180
+ type Context struct {
179
181
GOARCH string // target architecture
180
182
GOOS string // target operating system
181
183
GOROOT string // Go root
@@ -234,7 +236,8 @@ a local import path, like ".", "..", "./foo", or "../foo".
234
236
// OpenFile opens a file (not a directory) for reading.
235
237
// If OpenFile is nil, Import uses os.Open.
236
238
OpenFile func (path string ) (r io.ReadCloser , err error )
237
- }</pre >
239
+ }
240
+ ```
238
241
A Context specifies the supporting context for a build.
239
242
240
243
@@ -244,7 +247,6 @@ A Context specifies the supporting context for a build.
244
247
``` go
245
248
var Default Context = defaultContext ()
246
249
```
247
-
248
250
Default is the default Context for builds.
249
251
It uses the GOARCH, GOOS, GOROOT, and GOPATH environment variables
250
252
if set, or else the compiled code's GOARCH, GOOS, and GOROOT.
@@ -312,7 +314,9 @@ that do not exist.
312
314
313
315
314
316
## type ImportMode
315
- <pre >type ImportMode uint</pre >
317
+ ``` go
318
+ type ImportMode uint
319
+ ```
316
320
An ImportMode controls the behavior of the Import method.
317
321
318
322
@@ -338,11 +342,12 @@ const (
338
342
339
343
340
344
341
-
342
345
## type NoGoError
343
- <pre >type NoGoError struct {
346
+ ``` go
347
+ type NoGoError struct {
344
348
Dir string
345
- }</pre >
349
+ }
350
+ ```
346
351
NoGoError is the error used by Import to describe a directory
347
352
containing no buildable Go source files. (It may still contain
348
353
test files, files hidden by build tags, and so on.)
@@ -365,7 +370,8 @@ test files, files hidden by build tags, and so on.)
365
370
366
371
367
372
## type Package
368
- <pre >type Package struct {
373
+ ``` go
374
+ type Package struct {
369
375
Dir string // directory containing package sources
370
376
Name string // package name
371
377
Doc string // documentation synopsis
@@ -409,7 +415,8 @@ test files, files hidden by build tags, and so on.)
409
415
XTestGoFiles []string // _test.go files outside package
410
416
XTestImports []string // imports from XTestGoFiles
411
417
XTestImportPos map [string ][]token.Position // line information for XTestImports
412
- }</pre >
418
+ }
419
+ ```
413
420
A Package describes the Go package found in a directory.
414
421
415
422
@@ -421,16 +428,16 @@ A Package describes the Go package found in a directory.
421
428
422
429
423
430
### func Import
424
-
425
- func Import(path, srcDir string, mode ImportMode) (*Package, error)
426
-
431
+ ``` go
432
+ func Import (path , srcDir string , mode ImportMode ) (*Package , error )
433
+ ```
427
434
Import is shorthand for Default.Import.
428
435
429
436
430
437
### func ImportDir
431
-
432
- func ImportDir(dir string, mode ImportMode) (*Package, error)
433
-
438
+ ``` go
439
+ func ImportDir(dir string, mode ImportMode) (*Package, error)
440
+ ```
434
441
ImportDir is shorthand for Default.ImportDir.
435
442
436
443
0 commit comments