github.com/4ad/go@v0.0.0-20161219182952-69a12818b605/src/cmd/go/alldocs.go (about) 1 // Copyright 2011 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // DO NOT EDIT THIS FILE. GENERATED BY mkalldocs.sh. 6 // Edit the documentation in other files and rerun mkalldocs.sh to generate this one. 7 8 // Go is a tool for managing Go source code. 9 // 10 // Usage: 11 // 12 // go command [arguments] 13 // 14 // The commands are: 15 // 16 // build compile packages and dependencies 17 // clean remove object files 18 // doc show documentation for package or symbol 19 // env print Go environment information 20 // fix run go tool fix on packages 21 // fmt run gofmt on package sources 22 // generate generate Go files by processing source 23 // get download and install packages and dependencies 24 // install compile and install packages and dependencies 25 // list list packages 26 // run compile and run Go program 27 // test test packages 28 // tool run specified go tool 29 // version print Go version 30 // vet run go tool vet on packages 31 // 32 // Use "go help [command]" for more information about a command. 33 // 34 // Additional help topics: 35 // 36 // c calling between Go and C 37 // buildmode description of build modes 38 // filetype file types 39 // gopath GOPATH environment variable 40 // environment environment variables 41 // importpath import path syntax 42 // packages description of package lists 43 // testflag description of testing flags 44 // testfunc description of testing functions 45 // 46 // Use "go help [topic]" for more information about that topic. 47 // 48 // 49 // Compile packages and dependencies 50 // 51 // Usage: 52 // 53 // go build [-o output] [-i] [build flags] [packages] 54 // 55 // Build compiles the packages named by the import paths, 56 // along with their dependencies, but it does not install the results. 57 // 58 // If the arguments to build are a list of .go files, build treats 59 // them as a list of source files specifying a single package. 60 // 61 // When compiling a single main package, build writes 62 // the resulting executable to an output file named after 63 // the first source file ('go build ed.go rx.go' writes 'ed' or 'ed.exe') 64 // or the source code directory ('go build unix/sam' writes 'sam' or 'sam.exe'). 65 // The '.exe' suffix is added when writing a Windows executable. 66 // 67 // When compiling multiple packages or a single non-main package, 68 // build compiles the packages but discards the resulting object, 69 // serving only as a check that the packages can be built. 70 // 71 // When compiling packages, build ignores files that end in '_test.go'. 72 // 73 // The -o flag, only allowed when compiling a single package, 74 // forces build to write the resulting executable or object 75 // to the named output file, instead of the default behavior described 76 // in the last two paragraphs. 77 // 78 // The -i flag installs the packages that are dependencies of the target. 79 // 80 // The build flags are shared by the build, clean, get, install, list, run, 81 // and test commands: 82 // 83 // -a 84 // force rebuilding of packages that are already up-to-date. 85 // -n 86 // print the commands but do not run them. 87 // -p n 88 // the number of programs, such as build commands or 89 // test binaries, that can be run in parallel. 90 // The default is the number of CPUs available. 91 // -race 92 // enable data race detection. 93 // Supported only on linux/amd64, freebsd/amd64, darwin/amd64 and windows/amd64. 94 // -msan 95 // enable interoperation with memory sanitizer. 96 // Supported only on linux/amd64, 97 // and only with Clang/LLVM as the host C compiler. 98 // -v 99 // print the names of packages as they are compiled. 100 // -work 101 // print the name of the temporary work directory and 102 // do not delete it when exiting. 103 // -x 104 // print the commands. 105 // 106 // -asmflags 'flag list' 107 // arguments to pass on each go tool asm invocation. 108 // -buildmode mode 109 // build mode to use. See 'go help buildmode' for more. 110 // -compiler name 111 // name of compiler to use, as in runtime.Compiler (gccgo or gc). 112 // -gccgoflags 'arg list' 113 // arguments to pass on each gccgo compiler/linker invocation. 114 // -gcflags 'arg list' 115 // arguments to pass on each go tool compile invocation. 116 // -installsuffix suffix 117 // a suffix to use in the name of the package installation directory, 118 // in order to keep output separate from default builds. 119 // If using the -race flag, the install suffix is automatically set to race 120 // or, if set explicitly, has _race appended to it. Likewise for the -msan 121 // flag. Using a -buildmode option that requires non-default compile flags 122 // has a similar effect. 123 // -ldflags 'flag list' 124 // arguments to pass on each go tool link invocation. 125 // -linkshared 126 // link against shared libraries previously created with 127 // -buildmode=shared. 128 // -pkgdir dir 129 // install and load all packages from dir instead of the usual locations. 130 // For example, when building with a non-standard configuration, 131 // use -pkgdir to keep generated packages in a separate location. 132 // -tags 'tag list' 133 // a list of build tags to consider satisfied during the build. 134 // For more information about build tags, see the description of 135 // build constraints in the documentation for the go/build package. 136 // -toolexec 'cmd args' 137 // a program to use to invoke toolchain programs like vet and asm. 138 // For example, instead of running asm, the go command will run 139 // 'cmd args /path/to/asm <arguments for asm>'. 140 // 141 // The list flags accept a space-separated list of strings. To embed spaces 142 // in an element in the list, surround it with either single or double quotes. 143 // 144 // For more about specifying packages, see 'go help packages'. 145 // For more about where packages and binaries are installed, 146 // run 'go help gopath'. 147 // For more about calling between Go and C/C++, run 'go help c'. 148 // 149 // Note: Build adheres to certain conventions such as those described 150 // by 'go help gopath'. Not all projects can follow these conventions, 151 // however. Installations that have their own conventions or that use 152 // a separate software build system may choose to use lower-level 153 // invocations such as 'go tool compile' and 'go tool link' to avoid 154 // some of the overheads and design decisions of the build tool. 155 // 156 // See also: go install, go get, go clean. 157 // 158 // 159 // Remove object files 160 // 161 // Usage: 162 // 163 // go clean [-i] [-r] [-n] [-x] [build flags] [packages] 164 // 165 // Clean removes object files from package source directories. 166 // The go command builds most objects in a temporary directory, 167 // so go clean is mainly concerned with object files left by other 168 // tools or by manual invocations of go build. 169 // 170 // Specifically, clean removes the following files from each of the 171 // source directories corresponding to the import paths: 172 // 173 // _obj/ old object directory, left from Makefiles 174 // _test/ old test directory, left from Makefiles 175 // _testmain.go old gotest file, left from Makefiles 176 // test.out old test log, left from Makefiles 177 // build.out old test log, left from Makefiles 178 // *.[568ao] object files, left from Makefiles 179 // 180 // DIR(.exe) from go build 181 // DIR.test(.exe) from go test -c 182 // MAINFILE(.exe) from go build MAINFILE.go 183 // *.so from SWIG 184 // 185 // In the list, DIR represents the final path element of the 186 // directory, and MAINFILE is the base name of any Go source 187 // file in the directory that is not included when building 188 // the package. 189 // 190 // The -i flag causes clean to remove the corresponding installed 191 // archive or binary (what 'go install' would create). 192 // 193 // The -n flag causes clean to print the remove commands it would execute, 194 // but not run them. 195 // 196 // The -r flag causes clean to be applied recursively to all the 197 // dependencies of the packages named by the import paths. 198 // 199 // The -x flag causes clean to print remove commands as it executes them. 200 // 201 // For more about build flags, see 'go help build'. 202 // 203 // For more about specifying packages, see 'go help packages'. 204 // 205 // 206 // Show documentation for package or symbol 207 // 208 // Usage: 209 // 210 // go doc [-u] [-c] [package|[package.]symbol[.method]] 211 // 212 // Doc prints the documentation comments associated with the item identified by its 213 // arguments (a package, const, func, type, var, or method) followed by a one-line 214 // summary of each of the first-level items "under" that item (package-level 215 // declarations for a package, methods for a type, etc.). 216 // 217 // Doc accepts zero, one, or two arguments. 218 // 219 // Given no arguments, that is, when run as 220 // 221 // go doc 222 // 223 // it prints the package documentation for the package in the current directory. 224 // If the package is a command (package main), the exported symbols of the package 225 // are elided from the presentation unless the -cmd flag is provided. 226 // 227 // When run with one argument, the argument is treated as a Go-syntax-like 228 // representation of the item to be documented. What the argument selects depends 229 // on what is installed in GOROOT and GOPATH, as well as the form of the argument, 230 // which is schematically one of these: 231 // 232 // go doc <pkg> 233 // go doc <sym>[.<method>] 234 // go doc [<pkg>.]<sym>[.<method>] 235 // go doc [<pkg>.][<sym>.]<method> 236 // 237 // The first item in this list matched by the argument is the one whose documentation 238 // is printed. (See the examples below.) However, if the argument starts with a capital 239 // letter it is assumed to identify a symbol or method in the current directory. 240 // 241 // For packages, the order of scanning is determined lexically in breadth-first order. 242 // That is, the package presented is the one that matches the search and is nearest 243 // the root and lexically first at its level of the hierarchy. The GOROOT tree is 244 // always scanned in its entirety before GOPATH. 245 // 246 // If there is no package specified or matched, the package in the current 247 // directory is selected, so "go doc Foo" shows the documentation for symbol Foo in 248 // the current package. 249 // 250 // The package path must be either a qualified path or a proper suffix of a 251 // path. The go tool's usual package mechanism does not apply: package path 252 // elements like . and ... are not implemented by go doc. 253 // 254 // When run with two arguments, the first must be a full package path (not just a 255 // suffix), and the second is a symbol or symbol and method; this is similar to the 256 // syntax accepted by godoc: 257 // 258 // go doc <pkg> <sym>[.<method>] 259 // 260 // In all forms, when matching symbols, lower-case letters in the argument match 261 // either case but upper-case letters match exactly. This means that there may be 262 // multiple matches of a lower-case argument in a package if different symbols have 263 // different cases. If this occurs, documentation for all matches is printed. 264 // 265 // Examples: 266 // go doc 267 // Show documentation for current package. 268 // go doc Foo 269 // Show documentation for Foo in the current package. 270 // (Foo starts with a capital letter so it cannot match 271 // a package path.) 272 // go doc encoding/json 273 // Show documentation for the encoding/json package. 274 // go doc json 275 // Shorthand for encoding/json. 276 // go doc json.Number (or go doc json.number) 277 // Show documentation and method summary for json.Number. 278 // go doc json.Number.Int64 (or go doc json.number.int64) 279 // Show documentation for json.Number's Int64 method. 280 // go doc cmd/doc 281 // Show package docs for the doc command. 282 // go doc -cmd cmd/doc 283 // Show package docs and exported symbols within the doc command. 284 // go doc template.new 285 // Show documentation for html/template's New function. 286 // (html/template is lexically before text/template) 287 // go doc text/template.new # One argument 288 // Show documentation for text/template's New function. 289 // go doc text/template new # Two arguments 290 // Show documentation for text/template's New function. 291 // 292 // At least in the current tree, these invocations all print the 293 // documentation for json.Decoder's Decode method: 294 // 295 // go doc json.Decoder.Decode 296 // go doc json.decoder.decode 297 // go doc json.decode 298 // cd go/src/encoding/json; go doc decode 299 // 300 // Flags: 301 // -c 302 // Respect case when matching symbols. 303 // -cmd 304 // Treat a command (package main) like a regular package. 305 // Otherwise package main's exported symbols are hidden 306 // when showing the package's top-level documentation. 307 // -u 308 // Show documentation for unexported as well as exported 309 // symbols and methods. 310 // 311 // 312 // Print Go environment information 313 // 314 // Usage: 315 // 316 // go env [var ...] 317 // 318 // Env prints Go environment information. 319 // 320 // By default env prints information as a shell script 321 // (on Windows, a batch file). If one or more variable 322 // names is given as arguments, env prints the value of 323 // each named variable on its own line. 324 // 325 // 326 // Run go tool fix on packages 327 // 328 // Usage: 329 // 330 // go fix [packages] 331 // 332 // Fix runs the Go fix command on the packages named by the import paths. 333 // 334 // For more about fix, see 'go doc cmd/fix'. 335 // For more about specifying packages, see 'go help packages'. 336 // 337 // To run fix with specific options, run 'go tool fix'. 338 // 339 // See also: go fmt, go vet. 340 // 341 // 342 // Run gofmt on package sources 343 // 344 // Usage: 345 // 346 // go fmt [-n] [-x] [packages] 347 // 348 // Fmt runs the command 'gofmt -l -w' on the packages named 349 // by the import paths. It prints the names of the files that are modified. 350 // 351 // For more about gofmt, see 'go doc cmd/gofmt'. 352 // For more about specifying packages, see 'go help packages'. 353 // 354 // The -n flag prints commands that would be executed. 355 // The -x flag prints commands as they are executed. 356 // 357 // To run gofmt with specific options, run gofmt itself. 358 // 359 // See also: go fix, go vet. 360 // 361 // 362 // Generate Go files by processing source 363 // 364 // Usage: 365 // 366 // go generate [-run regexp] [-n] [-v] [-x] [build flags] [file.go... | packages] 367 // 368 // Generate runs commands described by directives within existing 369 // files. Those commands can run any process but the intent is to 370 // create or update Go source files, for instance by running yacc. 371 // 372 // Go generate is never run automatically by go build, go get, go test, 373 // and so on. It must be run explicitly. 374 // 375 // Go generate scans the file for directives, which are lines of 376 // the form, 377 // 378 // //go:generate command argument... 379 // 380 // (note: no leading spaces and no space in "//go") where command 381 // is the generator to be run, corresponding to an executable file 382 // that can be run locally. It must either be in the shell path 383 // (gofmt), a fully qualified path (/usr/you/bin/mytool), or a 384 // command alias, described below. 385 // 386 // Note that go generate does not parse the file, so lines that look 387 // like directives in comments or multiline strings will be treated 388 // as directives. 389 // 390 // The arguments to the directive are space-separated tokens or 391 // double-quoted strings passed to the generator as individual 392 // arguments when it is run. 393 // 394 // Quoted strings use Go syntax and are evaluated before execution; a 395 // quoted string appears as a single argument to the generator. 396 // 397 // Go generate sets several variables when it runs the generator: 398 // 399 // $GOARCH 400 // The execution architecture (arm, amd64, etc.) 401 // $GOOS 402 // The execution operating system (linux, windows, etc.) 403 // $GOFILE 404 // The base name of the file. 405 // $GOLINE 406 // The line number of the directive in the source file. 407 // $GOPACKAGE 408 // The name of the package of the file containing the directive. 409 // $DOLLAR 410 // A dollar sign. 411 // 412 // Other than variable substitution and quoted-string evaluation, no 413 // special processing such as "globbing" is performed on the command 414 // line. 415 // 416 // As a last step before running the command, any invocations of any 417 // environment variables with alphanumeric names, such as $GOFILE or 418 // $HOME, are expanded throughout the command line. The syntax for 419 // variable expansion is $NAME on all operating systems. Due to the 420 // order of evaluation, variables are expanded even inside quoted 421 // strings. If the variable NAME is not set, $NAME expands to the 422 // empty string. 423 // 424 // A directive of the form, 425 // 426 // //go:generate -command xxx args... 427 // 428 // specifies, for the remainder of this source file only, that the 429 // string xxx represents the command identified by the arguments. This 430 // can be used to create aliases or to handle multiword generators. 431 // For example, 432 // 433 // //go:generate -command yacc go tool yacc 434 // 435 // specifies that the command "yacc" represents the generator 436 // "go tool yacc". 437 // 438 // Generate processes packages in the order given on the command line, 439 // one at a time. If the command line lists .go files, they are treated 440 // as a single package. Within a package, generate processes the 441 // source files in a package in file name order, one at a time. Within 442 // a source file, generate runs generators in the order they appear 443 // in the file, one at a time. 444 // 445 // If any generator returns an error exit status, "go generate" skips 446 // all further processing for that package. 447 // 448 // The generator is run in the package's source directory. 449 // 450 // Go generate accepts one specific flag: 451 // 452 // -run="" 453 // if non-empty, specifies a regular expression to select 454 // directives whose full original source text (excluding 455 // any trailing spaces and final newline) matches the 456 // expression. 457 // 458 // It also accepts the standard build flags including -v, -n, and -x. 459 // The -v flag prints the names of packages and files as they are 460 // processed. 461 // The -n flag prints commands that would be executed. 462 // The -x flag prints commands as they are executed. 463 // 464 // For more about build flags, see 'go help build'. 465 // 466 // For more about specifying packages, see 'go help packages'. 467 // 468 // 469 // Download and install packages and dependencies 470 // 471 // Usage: 472 // 473 // go get [-d] [-f] [-fix] [-insecure] [-t] [-u] [build flags] [packages] 474 // 475 // Get downloads the packages named by the import paths, along with their 476 // dependencies. It then installs the named packages, like 'go install'. 477 // 478 // The -d flag instructs get to stop after downloading the packages; that is, 479 // it instructs get not to install the packages. 480 // 481 // The -f flag, valid only when -u is set, forces get -u not to verify that 482 // each package has been checked out from the source control repository 483 // implied by its import path. This can be useful if the source is a local fork 484 // of the original. 485 // 486 // The -fix flag instructs get to run the fix tool on the downloaded packages 487 // before resolving dependencies or building the code. 488 // 489 // The -insecure flag permits fetching from repositories and resolving 490 // custom domains using insecure schemes such as HTTP. Use with caution. 491 // 492 // The -t flag instructs get to also download the packages required to build 493 // the tests for the specified packages. 494 // 495 // The -u flag instructs get to use the network to update the named packages 496 // and their dependencies. By default, get uses the network to check out 497 // missing packages but does not use it to look for updates to existing packages. 498 // 499 // Get also accepts build flags to control the installation. See 'go help build'. 500 // 501 // When checking out a new package, get creates the target directory 502 // GOPATH/src/<import-path>. If the GOPATH contains multiple entries, 503 // get uses the first one. See 'go help gopath'. 504 // 505 // When checking out or updating a package, get looks for a branch or tag 506 // that matches the locally installed version of Go. The most important 507 // rule is that if the local installation is running version "go1", get 508 // searches for a branch or tag named "go1". If no such version exists it 509 // retrieves the most recent version of the package. 510 // 511 // When go get checks out or updates a Git repository, 512 // it also updates any git submodules referenced by the repository. 513 // 514 // Get never checks out or updates code stored in vendor directories. 515 // 516 // For more about specifying packages, see 'go help packages'. 517 // 518 // For more about how 'go get' finds source code to 519 // download, see 'go help importpath'. 520 // 521 // See also: go build, go install, go clean. 522 // 523 // 524 // Compile and install packages and dependencies 525 // 526 // Usage: 527 // 528 // go install [build flags] [packages] 529 // 530 // Install compiles and installs the packages named by the import paths, 531 // along with their dependencies. 532 // 533 // For more about the build flags, see 'go help build'. 534 // For more about specifying packages, see 'go help packages'. 535 // 536 // See also: go build, go get, go clean. 537 // 538 // 539 // List packages 540 // 541 // Usage: 542 // 543 // go list [-e] [-f format] [-json] [build flags] [packages] 544 // 545 // List lists the packages named by the import paths, one per line. 546 // 547 // The default output shows the package import path: 548 // 549 // bytes 550 // encoding/json 551 // github.com/gorilla/mux 552 // golang.org/x/net/html 553 // 554 // The -f flag specifies an alternate format for the list, using the 555 // syntax of package template. The default output is equivalent to -f 556 // '{{.ImportPath}}'. The struct being passed to the template is: 557 // 558 // type Package struct { 559 // Dir string // directory containing package sources 560 // ImportPath string // import path of package in dir 561 // ImportComment string // path in import comment on package statement 562 // Name string // package name 563 // Doc string // package documentation string 564 // Target string // install path 565 // Shlib string // the shared library that contains this package (only set when -linkshared) 566 // Goroot bool // is this package in the Go root? 567 // Standard bool // is this package part of the standard Go library? 568 // Stale bool // would 'go install' do anything for this package? 569 // StaleReason string // explanation for Stale==true 570 // Root string // Go root or Go path dir containing this package 571 // ConflictDir string // this directory shadows Dir in $GOPATH 572 // BinaryOnly bool // binary-only package: cannot be recompiled from sources 573 // 574 // // Source files 575 // GoFiles []string // .go source files (excluding CgoFiles, TestGoFiles, XTestGoFiles) 576 // CgoFiles []string // .go sources files that import "C" 577 // IgnoredGoFiles []string // .go sources ignored due to build constraints 578 // CFiles []string // .c source files 579 // CXXFiles []string // .cc, .cxx and .cpp source files 580 // MFiles []string // .m source files 581 // HFiles []string // .h, .hh, .hpp and .hxx source files 582 // FFiles []string // .f, .F, .for and .f90 Fortran source files 583 // SFiles []string // .s source files 584 // SwigFiles []string // .swig files 585 // SwigCXXFiles []string // .swigcxx files 586 // SysoFiles []string // .syso object files to add to archive 587 // 588 // // Cgo directives 589 // CgoCFLAGS []string // cgo: flags for C compiler 590 // CgoCPPFLAGS []string // cgo: flags for C preprocessor 591 // CgoCXXFLAGS []string // cgo: flags for C++ compiler 592 // CgoFFLAGS []string // cgo: flags for Fortran compiler 593 // CgoLDFLAGS []string // cgo: flags for linker 594 // CgoPkgConfig []string // cgo: pkg-config names 595 // 596 // // Dependency information 597 // Imports []string // import paths used by this package 598 // Deps []string // all (recursively) imported dependencies 599 // 600 // // Error information 601 // Incomplete bool // this package or a dependency has an error 602 // Error *PackageError // error loading package 603 // DepsErrors []*PackageError // errors loading dependencies 604 // 605 // TestGoFiles []string // _test.go files in package 606 // TestImports []string // imports from TestGoFiles 607 // XTestGoFiles []string // _test.go files outside package 608 // XTestImports []string // imports from XTestGoFiles 609 // } 610 // 611 // The error information, if any, is 612 // 613 // type PackageError struct { 614 // ImportStack []string // shortest path from package named on command line to this one 615 // Pos string // position of error (if present, file:line:col) 616 // Err string // the error itself 617 // } 618 // 619 // The template function "join" calls strings.Join. 620 // 621 // The template function "context" returns the build context, defined as: 622 // 623 // type Context struct { 624 // GOARCH string // target architecture 625 // GOOS string // target operating system 626 // GOROOT string // Go root 627 // GOPATH string // Go path 628 // CgoEnabled bool // whether cgo can be used 629 // UseAllFiles bool // use files regardless of +build lines, file names 630 // Compiler string // compiler to assume when computing target paths 631 // BuildTags []string // build constraints to match in +build lines 632 // ReleaseTags []string // releases the current release is compatible with 633 // InstallSuffix string // suffix to use in the name of the install dir 634 // } 635 // 636 // For more information about the meaning of these fields see the documentation 637 // for the go/build package's Context type. 638 // 639 // The -json flag causes the package data to be printed in JSON format 640 // instead of using the template format. 641 // 642 // The -e flag changes the handling of erroneous packages, those that 643 // cannot be found or are malformed. By default, the list command 644 // prints an error to standard error for each erroneous package and 645 // omits the packages from consideration during the usual printing. 646 // With the -e flag, the list command never prints errors to standard 647 // error and instead processes the erroneous packages with the usual 648 // printing. Erroneous packages will have a non-empty ImportPath and 649 // a non-nil Error field; other information may or may not be missing 650 // (zeroed). 651 // 652 // For more about build flags, see 'go help build'. 653 // 654 // For more about specifying packages, see 'go help packages'. 655 // 656 // 657 // Compile and run Go program 658 // 659 // Usage: 660 // 661 // go run [build flags] [-exec xprog] gofiles... [arguments...] 662 // 663 // Run compiles and runs the main package comprising the named Go source files. 664 // A Go source file is defined to be a file ending in a literal ".go" suffix. 665 // 666 // By default, 'go run' runs the compiled binary directly: 'a.out arguments...'. 667 // If the -exec flag is given, 'go run' invokes the binary using xprog: 668 // 'xprog a.out arguments...'. 669 // If the -exec flag is not given, GOOS or GOARCH is different from the system 670 // default, and a program named go_$GOOS_$GOARCH_exec can be found 671 // on the current search path, 'go run' invokes the binary using that program, 672 // for example 'go_nacl_386_exec a.out arguments...'. This allows execution of 673 // cross-compiled programs when a simulator or other execution method is 674 // available. 675 // 676 // For more about build flags, see 'go help build'. 677 // 678 // See also: go build. 679 // 680 // 681 // Test packages 682 // 683 // Usage: 684 // 685 // go test [build/test flags] [packages] [build/test flags & test binary flags] 686 // 687 // 'Go test' automates testing the packages named by the import paths. 688 // It prints a summary of the test results in the format: 689 // 690 // ok archive/tar 0.011s 691 // FAIL archive/zip 0.022s 692 // ok compress/gzip 0.033s 693 // ... 694 // 695 // followed by detailed output for each failed package. 696 // 697 // 'Go test' recompiles each package along with any files with names matching 698 // the file pattern "*_test.go". 699 // Files whose names begin with "_" (including "_test.go") or "." are ignored. 700 // These additional files can contain test functions, benchmark functions, and 701 // example functions. See 'go help testfunc' for more. 702 // Each listed package causes the execution of a separate test binary. 703 // 704 // Test files that declare a package with the suffix "_test" will be compiled as a 705 // separate package, and then linked and run with the main test binary. 706 // 707 // The go tool will ignore a directory named "testdata", making it available 708 // to hold ancillary data needed by the tests. 709 // 710 // By default, go test needs no arguments. It compiles and tests the package 711 // with source in the current directory, including tests, and runs the tests. 712 // 713 // The package is built in a temporary directory so it does not interfere with the 714 // non-test installation. 715 // 716 // In addition to the build flags, the flags handled by 'go test' itself are: 717 // 718 // -args 719 // Pass the remainder of the command line (everything after -args) 720 // to the test binary, uninterpreted and unchanged. 721 // Because this flag consumes the remainder of the command line, 722 // the package list (if present) must appear before this flag. 723 // 724 // -c 725 // Compile the test binary to pkg.test but do not run it 726 // (where pkg is the last element of the package's import path). 727 // The file name can be changed with the -o flag. 728 // 729 // -exec xprog 730 // Run the test binary using xprog. The behavior is the same as 731 // in 'go run'. See 'go help run' for details. 732 // 733 // -i 734 // Install packages that are dependencies of the test. 735 // Do not run the test. 736 // 737 // -o file 738 // Compile the test binary to the named file. 739 // The test still runs (unless -c or -i is specified). 740 // 741 // The test binary also accepts flags that control execution of the test; these 742 // flags are also accessible by 'go test'. See 'go help testflag' for details. 743 // 744 // For more about build flags, see 'go help build'. 745 // For more about specifying packages, see 'go help packages'. 746 // 747 // See also: go build, go vet. 748 // 749 // 750 // Run specified go tool 751 // 752 // Usage: 753 // 754 // go tool [-n] command [args...] 755 // 756 // Tool runs the go tool command identified by the arguments. 757 // With no arguments it prints the list of known tools. 758 // 759 // The -n flag causes tool to print the command that would be 760 // executed but not execute it. 761 // 762 // For more about each tool command, see 'go tool command -h'. 763 // 764 // 765 // Print Go version 766 // 767 // Usage: 768 // 769 // go version 770 // 771 // Version prints the Go version, as reported by runtime.Version. 772 // 773 // 774 // Run go tool vet on packages 775 // 776 // Usage: 777 // 778 // go vet [-n] [-x] [build flags] [packages] 779 // 780 // Vet runs the Go vet command on the packages named by the import paths. 781 // 782 // For more about vet, see 'go doc cmd/vet'. 783 // For more about specifying packages, see 'go help packages'. 784 // 785 // To run the vet tool with specific options, run 'go tool vet'. 786 // 787 // The -n flag prints commands that would be executed. 788 // The -x flag prints commands as they are executed. 789 // 790 // For more about build flags, see 'go help build'. 791 // 792 // See also: go fmt, go fix. 793 // 794 // 795 // Calling between Go and C 796 // 797 // There are two different ways to call between Go and C/C++ code. 798 // 799 // The first is the cgo tool, which is part of the Go distribution. For 800 // information on how to use it see the cgo documentation (go doc cmd/cgo). 801 // 802 // The second is the SWIG program, which is a general tool for 803 // interfacing between languages. For information on SWIG see 804 // http://swig.org/. When running go build, any file with a .swig 805 // extension will be passed to SWIG. Any file with a .swigcxx extension 806 // will be passed to SWIG with the -c++ option. 807 // 808 // When either cgo or SWIG is used, go build will pass any .c, .m, .s, 809 // or .S files to the C compiler, and any .cc, .cpp, .cxx files to the C++ 810 // compiler. The CC or CXX environment variables may be set to determine 811 // the C or C++ compiler, respectively, to use. 812 // 813 // 814 // Description of build modes 815 // 816 // The 'go build' and 'go install' commands take a -buildmode argument which 817 // indicates which kind of object file is to be built. Currently supported values 818 // are: 819 // 820 // -buildmode=archive 821 // Build the listed non-main packages into .a files. Packages named 822 // main are ignored. 823 // 824 // -buildmode=c-archive 825 // Build the listed main package, plus all packages it imports, 826 // into a C archive file. The only callable symbols will be those 827 // functions exported using a cgo //export comment. Requires 828 // exactly one main package to be listed. 829 // 830 // -buildmode=c-shared 831 // Build the listed main packages, plus all packages that they 832 // import, into C shared libraries. The only callable symbols will 833 // be those functions exported using a cgo //export comment. 834 // Non-main packages are ignored. 835 // 836 // -buildmode=default 837 // Listed main packages are built into executables and listed 838 // non-main packages are built into .a files (the default 839 // behavior). 840 // 841 // -buildmode=shared 842 // Combine all the listed non-main packages into a single shared 843 // library that will be used when building with the -linkshared 844 // option. Packages named main are ignored. 845 // 846 // -buildmode=exe 847 // Build the listed main packages and everything they import into 848 // executables. Packages not named main are ignored. 849 // 850 // -buildmode=pie 851 // Build the listed main packages and everything they import into 852 // position independent executables (PIE). Packages not named 853 // main are ignored. 854 // 855 // 856 // File types 857 // 858 // The go command examines the contents of a restricted set of files 859 // in each directory. It identifies which files to examine based on 860 // the extension of the file name. These extensions are: 861 // 862 // .go 863 // Go source files. 864 // .c, .h 865 // C source files. 866 // If the package uses cgo or SWIG, these will be compiled with the 867 // OS-native compiler (typically gcc); otherwise they will 868 // trigger an error. 869 // .cc, .cpp, .cxx, .hh, .hpp, .hxx 870 // C++ source files. Only useful with cgo or SWIG, and always 871 // compiled with the OS-native compiler. 872 // .m 873 // Objective-C source files. Only useful with cgo, and always 874 // compiled with the OS-native compiler. 875 // .s, .S 876 // Assembler source files. 877 // If the package uses cgo or SWIG, these will be assembled with the 878 // OS-native assembler (typically gcc (sic)); otherwise they 879 // will be assembled with the Go assembler. 880 // .swig, .swigcxx 881 // SWIG definition files. 882 // .syso 883 // System object files. 884 // 885 // Files of each of these types except .syso may contain build 886 // constraints, but the go command stops scanning for build constraints 887 // at the first item in the file that is not a blank line or //-style 888 // line comment. See the go/build package documentation for 889 // more details. 890 // 891 // Non-test Go source files can also include a //go:binary-only-package 892 // comment, indicating that the package sources are included 893 // for documentation only and must not be used to build the 894 // package binary. This enables distribution of Go packages in 895 // their compiled form alone. See the go/build package documentation 896 // for more details. 897 // 898 // 899 // GOPATH environment variable 900 // 901 // The Go path is used to resolve import statements. 902 // It is implemented by and documented in the go/build package. 903 // 904 // The GOPATH environment variable lists places to look for Go code. 905 // On Unix, the value is a colon-separated string. 906 // On Windows, the value is a semicolon-separated string. 907 // On Plan 9, the value is a list. 908 // 909 // GOPATH must be set to get, build and install packages outside the 910 // standard Go tree. 911 // 912 // Each directory listed in GOPATH must have a prescribed structure: 913 // 914 // The src directory holds source code. The path below src 915 // determines the import path or executable name. 916 // 917 // The pkg directory holds installed package objects. 918 // As in the Go tree, each target operating system and 919 // architecture pair has its own subdirectory of pkg 920 // (pkg/GOOS_GOARCH). 921 // 922 // If DIR is a directory listed in the GOPATH, a package with 923 // source in DIR/src/foo/bar can be imported as "foo/bar" and 924 // has its compiled form installed to "DIR/pkg/GOOS_GOARCH/foo/bar.a". 925 // 926 // The bin directory holds compiled commands. 927 // Each command is named for its source directory, but only 928 // the final element, not the entire path. That is, the 929 // command with source in DIR/src/foo/quux is installed into 930 // DIR/bin/quux, not DIR/bin/foo/quux. The "foo/" prefix is stripped 931 // so that you can add DIR/bin to your PATH to get at the 932 // installed commands. If the GOBIN environment variable is 933 // set, commands are installed to the directory it names instead 934 // of DIR/bin. GOBIN must be an absolute path. 935 // 936 // Here's an example directory layout: 937 // 938 // GOPATH=/home/user/gocode 939 // 940 // /home/user/gocode/ 941 // src/ 942 // foo/ 943 // bar/ (go code in package bar) 944 // x.go 945 // quux/ (go code in package main) 946 // y.go 947 // bin/ 948 // quux (installed command) 949 // pkg/ 950 // linux_amd64/ 951 // foo/ 952 // bar.a (installed package object) 953 // 954 // Go searches each directory listed in GOPATH to find source code, 955 // but new packages are always downloaded into the first directory 956 // in the list. 957 // 958 // See https://golang.org/doc/code.html for an example. 959 // 960 // Internal Directories 961 // 962 // Code in or below a directory named "internal" is importable only 963 // by code in the directory tree rooted at the parent of "internal". 964 // Here's an extended version of the directory layout above: 965 // 966 // /home/user/gocode/ 967 // src/ 968 // crash/ 969 // bang/ (go code in package bang) 970 // b.go 971 // foo/ (go code in package foo) 972 // f.go 973 // bar/ (go code in package bar) 974 // x.go 975 // internal/ 976 // baz/ (go code in package baz) 977 // z.go 978 // quux/ (go code in package main) 979 // y.go 980 // 981 // 982 // The code in z.go is imported as "foo/internal/baz", but that 983 // import statement can only appear in source files in the subtree 984 // rooted at foo. The source files foo/f.go, foo/bar/x.go, and 985 // foo/quux/y.go can all import "foo/internal/baz", but the source file 986 // crash/bang/b.go cannot. 987 // 988 // See https://golang.org/s/go14internal for details. 989 // 990 // Vendor Directories 991 // 992 // Go 1.6 includes support for using local copies of external dependencies 993 // to satisfy imports of those dependencies, often referred to as vendoring. 994 // 995 // Code below a directory named "vendor" is importable only 996 // by code in the directory tree rooted at the parent of "vendor", 997 // and only using an import path that omits the prefix up to and 998 // including the vendor element. 999 // 1000 // Here's the example from the previous section, 1001 // but with the "internal" directory renamed to "vendor" 1002 // and a new foo/vendor/crash/bang directory added: 1003 // 1004 // /home/user/gocode/ 1005 // src/ 1006 // crash/ 1007 // bang/ (go code in package bang) 1008 // b.go 1009 // foo/ (go code in package foo) 1010 // f.go 1011 // bar/ (go code in package bar) 1012 // x.go 1013 // vendor/ 1014 // crash/ 1015 // bang/ (go code in package bang) 1016 // b.go 1017 // baz/ (go code in package baz) 1018 // z.go 1019 // quux/ (go code in package main) 1020 // y.go 1021 // 1022 // The same visibility rules apply as for internal, but the code 1023 // in z.go is imported as "baz", not as "foo/vendor/baz". 1024 // 1025 // Code in vendor directories deeper in the source tree shadows 1026 // code in higher directories. Within the subtree rooted at foo, an import 1027 // of "crash/bang" resolves to "foo/vendor/crash/bang", not the 1028 // top-level "crash/bang". 1029 // 1030 // Code in vendor directories is not subject to import path 1031 // checking (see 'go help importpath'). 1032 // 1033 // When 'go get' checks out or updates a git repository, it now also 1034 // updates submodules. 1035 // 1036 // Vendor directories do not affect the placement of new repositories 1037 // being checked out for the first time by 'go get': those are always 1038 // placed in the main GOPATH, never in a vendor subtree. 1039 // 1040 // See https://golang.org/s/go15vendor for details. 1041 // 1042 // 1043 // Environment variables 1044 // 1045 // The go command, and the tools it invokes, examine a few different 1046 // environment variables. For many of these, you can see the default 1047 // value of on your system by running 'go env NAME', where NAME is the 1048 // name of the variable. 1049 // 1050 // General-purpose environment variables: 1051 // 1052 // GCCGO 1053 // The gccgo command to run for 'go build -compiler=gccgo'. 1054 // GOARCH 1055 // The architecture, or processor, for which to compile code. 1056 // Examples are amd64, 386, arm, ppc64. 1057 // GOBIN 1058 // The directory where 'go install' will install a command. 1059 // GOOS 1060 // The operating system for which to compile code. 1061 // Examples are linux, darwin, windows, netbsd. 1062 // GOPATH 1063 // See 'go help gopath'. 1064 // GORACE 1065 // Options for the race detector. 1066 // See https://golang.org/doc/articles/race_detector.html. 1067 // GOROOT 1068 // The root of the go tree. 1069 // 1070 // Environment variables for use with cgo: 1071 // 1072 // CC 1073 // The command to use to compile C code. 1074 // CGO_ENABLED 1075 // Whether the cgo command is supported. Either 0 or 1. 1076 // CGO_CFLAGS 1077 // Flags that cgo will pass to the compiler when compiling 1078 // C code. 1079 // CGO_CPPFLAGS 1080 // Flags that cgo will pass to the compiler when compiling 1081 // C or C++ code. 1082 // CGO_CXXFLAGS 1083 // Flags that cgo will pass to the compiler when compiling 1084 // C++ code. 1085 // CGO_LDFLAGS 1086 // Flags that cgo will pass to the compiler when linking. 1087 // CXX 1088 // The command to use to compile C++ code. 1089 // 1090 // Architecture-specific environment variables: 1091 // 1092 // GOARM 1093 // For GOARCH=arm, the ARM architecture for which to compile. 1094 // Valid values are 5, 6, 7. 1095 // GO386 1096 // For GOARCH=386, the floating point instruction set. 1097 // Valid values are 387, sse2. 1098 // 1099 // Special-purpose environment variables: 1100 // 1101 // GOROOT_FINAL 1102 // The root of the installed Go tree, when it is 1103 // installed in a location other than where it is built. 1104 // File names in stack traces are rewritten from GOROOT to 1105 // GOROOT_FINAL. 1106 // GO_EXTLINK_ENABLED 1107 // Whether the linker should use external linking mode 1108 // when using -linkmode=auto with code that uses cgo. 1109 // Set to 0 to disable external linking mode, 1 to enable it. 1110 // 1111 // 1112 // Import path syntax 1113 // 1114 // An import path (see 'go help packages') denotes a package 1115 // stored in the local file system. In general, an import path denotes 1116 // either a standard package (such as "unicode/utf8") or a package 1117 // found in one of the work spaces (see 'go help gopath'). 1118 // 1119 // Relative import paths 1120 // 1121 // An import path beginning with ./ or ../ is called a relative path. 1122 // The toolchain supports relative import paths as a shortcut in two ways. 1123 // 1124 // First, a relative path can be used as a shorthand on the command line. 1125 // If you are working in the directory containing the code imported as 1126 // "unicode" and want to run the tests for "unicode/utf8", you can type 1127 // "go test ./utf8" instead of needing to specify the full path. 1128 // Similarly, in the reverse situation, "go test .." will test "unicode" from 1129 // the "unicode/utf8" directory. Relative patterns are also allowed, like 1130 // "go test ./..." to test all subdirectories. See 'go help packages' for details 1131 // on the pattern syntax. 1132 // 1133 // Second, if you are compiling a Go program not in a work space, 1134 // you can use a relative path in an import statement in that program 1135 // to refer to nearby code also not in a work space. 1136 // This makes it easy to experiment with small multipackage programs 1137 // outside of the usual work spaces, but such programs cannot be 1138 // installed with "go install" (there is no work space in which to install them), 1139 // so they are rebuilt from scratch each time they are built. 1140 // To avoid ambiguity, Go programs cannot use relative import paths 1141 // within a work space. 1142 // 1143 // Remote import paths 1144 // 1145 // Certain import paths also 1146 // describe how to obtain the source code for the package using 1147 // a revision control system. 1148 // 1149 // A few common code hosting sites have special syntax: 1150 // 1151 // Bitbucket (Git, Mercurial) 1152 // 1153 // import "bitbucket.org/user/project" 1154 // import "bitbucket.org/user/project/sub/directory" 1155 // 1156 // GitHub (Git) 1157 // 1158 // import "github.com/user/project" 1159 // import "github.com/user/project/sub/directory" 1160 // 1161 // Launchpad (Bazaar) 1162 // 1163 // import "launchpad.net/project" 1164 // import "launchpad.net/project/series" 1165 // import "launchpad.net/project/series/sub/directory" 1166 // 1167 // import "launchpad.net/~user/project/branch" 1168 // import "launchpad.net/~user/project/branch/sub/directory" 1169 // 1170 // IBM DevOps Services (Git) 1171 // 1172 // import "hub.jazz.net/git/user/project" 1173 // import "hub.jazz.net/git/user/project/sub/directory" 1174 // 1175 // For code hosted on other servers, import paths may either be qualified 1176 // with the version control type, or the go tool can dynamically fetch 1177 // the import path over https/http and discover where the code resides 1178 // from a <meta> tag in the HTML. 1179 // 1180 // To declare the code location, an import path of the form 1181 // 1182 // repository.vcs/path 1183 // 1184 // specifies the given repository, with or without the .vcs suffix, 1185 // using the named version control system, and then the path inside 1186 // that repository. The supported version control systems are: 1187 // 1188 // Bazaar .bzr 1189 // Git .git 1190 // Mercurial .hg 1191 // Subversion .svn 1192 // 1193 // For example, 1194 // 1195 // import "example.org/user/foo.hg" 1196 // 1197 // denotes the root directory of the Mercurial repository at 1198 // example.org/user/foo or foo.hg, and 1199 // 1200 // import "example.org/repo.git/foo/bar" 1201 // 1202 // denotes the foo/bar directory of the Git repository at 1203 // example.org/repo or repo.git. 1204 // 1205 // When a version control system supports multiple protocols, 1206 // each is tried in turn when downloading. For example, a Git 1207 // download tries https://, then git+ssh://. 1208 // 1209 // If the import path is not a known code hosting site and also lacks a 1210 // version control qualifier, the go tool attempts to fetch the import 1211 // over https/http and looks for a <meta> tag in the document's HTML 1212 // <head>. 1213 // 1214 // The meta tag has the form: 1215 // 1216 // <meta name="go-import" content="import-prefix vcs repo-root"> 1217 // 1218 // The import-prefix is the import path corresponding to the repository 1219 // root. It must be a prefix or an exact match of the package being 1220 // fetched with "go get". If it's not an exact match, another http 1221 // request is made at the prefix to verify the <meta> tags match. 1222 // 1223 // The meta tag should appear as early in the file as possible. 1224 // In particular, it should appear before any raw JavaScript or CSS, 1225 // to avoid confusing the go command's restricted parser. 1226 // 1227 // The vcs is one of "git", "hg", "svn", etc, 1228 // 1229 // The repo-root is the root of the version control system 1230 // containing a scheme and not containing a .vcs qualifier. 1231 // 1232 // For example, 1233 // 1234 // import "example.org/pkg/foo" 1235 // 1236 // will result in the following requests: 1237 // 1238 // https://example.org/pkg/foo?go-get=1 (preferred) 1239 // http://example.org/pkg/foo?go-get=1 (fallback, only with -insecure) 1240 // 1241 // If that page contains the meta tag 1242 // 1243 // <meta name="go-import" content="example.org git https://code.org/r/p/exproj"> 1244 // 1245 // the go tool will verify that https://example.org/?go-get=1 contains the 1246 // same meta tag and then git clone https://code.org/r/p/exproj into 1247 // GOPATH/src/example.org. 1248 // 1249 // New downloaded packages are written to the first directory 1250 // listed in the GOPATH environment variable (see 'go help gopath'). 1251 // 1252 // The go command attempts to download the version of the 1253 // package appropriate for the Go release being used. 1254 // Run 'go help get' for more. 1255 // 1256 // Import path checking 1257 // 1258 // When the custom import path feature described above redirects to a 1259 // known code hosting site, each of the resulting packages has two possible 1260 // import paths, using the custom domain or the known hosting site. 1261 // 1262 // A package statement is said to have an "import comment" if it is immediately 1263 // followed (before the next newline) by a comment of one of these two forms: 1264 // 1265 // package math // import "path" 1266 // package math /* import "path" */ 1267 // 1268 // The go command will refuse to install a package with an import comment 1269 // unless it is being referred to by that import path. In this way, import comments 1270 // let package authors make sure the custom import path is used and not a 1271 // direct path to the underlying code hosting site. 1272 // 1273 // Import path checking is disabled for code found within vendor trees. 1274 // This makes it possible to copy code into alternate locations in vendor trees 1275 // without needing to update import comments. 1276 // 1277 // See https://golang.org/s/go14customimport for details. 1278 // 1279 // 1280 // Description of package lists 1281 // 1282 // Many commands apply to a set of packages: 1283 // 1284 // go action [packages] 1285 // 1286 // Usually, [packages] is a list of import paths. 1287 // 1288 // An import path that is a rooted path or that begins with 1289 // a . or .. element is interpreted as a file system path and 1290 // denotes the package in that directory. 1291 // 1292 // Otherwise, the import path P denotes the package found in 1293 // the directory DIR/src/P for some DIR listed in the GOPATH 1294 // environment variable (see 'go help gopath'). 1295 // 1296 // If no import paths are given, the action applies to the 1297 // package in the current directory. 1298 // 1299 // There are four reserved names for paths that should not be used 1300 // for packages to be built with the go tool: 1301 // 1302 // - "main" denotes the top-level package in a stand-alone executable. 1303 // 1304 // - "all" expands to all package directories found in all the GOPATH 1305 // trees. For example, 'go list all' lists all the packages on the local 1306 // system. 1307 // 1308 // - "std" is like all but expands to just the packages in the standard 1309 // Go library. 1310 // 1311 // - "cmd" expands to the Go repository's commands and their 1312 // internal libraries. 1313 // 1314 // An import path is a pattern if it includes one or more "..." wildcards, 1315 // each of which can match any string, including the empty string and 1316 // strings containing slashes. Such a pattern expands to all package 1317 // directories found in the GOPATH trees with names matching the 1318 // patterns. As a special case, x/... matches x as well as x's subdirectories. 1319 // For example, net/... expands to net and packages in its subdirectories. 1320 // 1321 // An import path can also name a package to be downloaded from 1322 // a remote repository. Run 'go help importpath' for details. 1323 // 1324 // Every package in a program must have a unique import path. 1325 // By convention, this is arranged by starting each path with a 1326 // unique prefix that belongs to you. For example, paths used 1327 // internally at Google all begin with 'google', and paths 1328 // denoting remote repositories begin with the path to the code, 1329 // such as 'github.com/user/repo'. 1330 // 1331 // Packages in a program need not have unique package names, 1332 // but there are two reserved package names with special meaning. 1333 // The name main indicates a command, not a library. 1334 // Commands are built into binaries and cannot be imported. 1335 // The name documentation indicates documentation for 1336 // a non-Go program in the directory. Files in package documentation 1337 // are ignored by the go command. 1338 // 1339 // As a special case, if the package list is a list of .go files from a 1340 // single directory, the command is applied to a single synthesized 1341 // package made up of exactly those files, ignoring any build constraints 1342 // in those files and ignoring any other files in the directory. 1343 // 1344 // Directory and file names that begin with "." or "_" are ignored 1345 // by the go tool, as are directories named "testdata". 1346 // 1347 // 1348 // Description of testing flags 1349 // 1350 // The 'go test' command takes both flags that apply to 'go test' itself 1351 // and flags that apply to the resulting test binary. 1352 // 1353 // Several of the flags control profiling and write an execution profile 1354 // suitable for "go tool pprof"; run "go tool pprof -h" for more 1355 // information. The --alloc_space, --alloc_objects, and --show_bytes 1356 // options of pprof control how the information is presented. 1357 // 1358 // The following flags are recognized by the 'go test' command and 1359 // control the execution of any test: 1360 // 1361 // -bench regexp 1362 // Run (sub)benchmarks matching a regular expression. 1363 // The given regular expression is split into smaller ones by 1364 // top-level '/', where each must match the corresponding part of a 1365 // benchmark's identifier. 1366 // By default, no benchmarks run. To run all benchmarks, 1367 // use '-bench .' or '-bench=.'. 1368 // 1369 // -benchmem 1370 // Print memory allocation statistics for benchmarks. 1371 // 1372 // -benchtime t 1373 // Run enough iterations of each benchmark to take t, specified 1374 // as a time.Duration (for example, -benchtime 1h30s). 1375 // The default is 1 second (1s). 1376 // 1377 // -blockprofile block.out 1378 // Write a goroutine blocking profile to the specified file 1379 // when all tests are complete. 1380 // Writes test binary as -c would. 1381 // 1382 // -blockprofilerate n 1383 // Control the detail provided in goroutine blocking profiles by 1384 // calling runtime.SetBlockProfileRate with n. 1385 // See 'go doc runtime.SetBlockProfileRate'. 1386 // The profiler aims to sample, on average, one blocking event every 1387 // n nanoseconds the program spends blocked. By default, 1388 // if -test.blockprofile is set without this flag, all blocking events 1389 // are recorded, equivalent to -test.blockprofilerate=1. 1390 // 1391 // -count n 1392 // Run each test and benchmark n times (default 1). 1393 // If -cpu is set, run n times for each GOMAXPROCS value. 1394 // Examples are always run once. 1395 // 1396 // -cover 1397 // Enable coverage analysis. 1398 // 1399 // -covermode set,count,atomic 1400 // Set the mode for coverage analysis for the package[s] 1401 // being tested. The default is "set" unless -race is enabled, 1402 // in which case it is "atomic". 1403 // The values: 1404 // set: bool: does this statement run? 1405 // count: int: how many times does this statement run? 1406 // atomic: int: count, but correct in multithreaded tests; 1407 // significantly more expensive. 1408 // Sets -cover. 1409 // 1410 // -coverpkg pkg1,pkg2,pkg3 1411 // Apply coverage analysis in each test to the given list of packages. 1412 // The default is for each test to analyze only the package being tested. 1413 // Packages are specified as import paths. 1414 // Sets -cover. 1415 // 1416 // -coverprofile cover.out 1417 // Write a coverage profile to the file after all tests have passed. 1418 // Sets -cover. 1419 // 1420 // -cpu 1,2,4 1421 // Specify a list of GOMAXPROCS values for which the tests or 1422 // benchmarks should be executed. The default is the current value 1423 // of GOMAXPROCS. 1424 // 1425 // -cpuprofile cpu.out 1426 // Write a CPU profile to the specified file before exiting. 1427 // Writes test binary as -c would. 1428 // 1429 // -memprofile mem.out 1430 // Write a memory profile to the file after all tests have passed. 1431 // Writes test binary as -c would. 1432 // 1433 // -memprofilerate n 1434 // Enable more precise (and expensive) memory profiles by setting 1435 // runtime.MemProfileRate. See 'go doc runtime.MemProfileRate'. 1436 // To profile all memory allocations, use -test.memprofilerate=1 1437 // and pass --alloc_space flag to the pprof tool. 1438 // 1439 // -outputdir directory 1440 // Place output files from profiling in the specified directory, 1441 // by default the directory in which "go test" is running. 1442 // 1443 // -parallel n 1444 // Allow parallel execution of test functions that call t.Parallel. 1445 // The value of this flag is the maximum number of tests to run 1446 // simultaneously; by default, it is set to the value of GOMAXPROCS. 1447 // Note that -parallel only applies within a single test binary. 1448 // The 'go test' command may run tests for different packages 1449 // in parallel as well, according to the setting of the -p flag 1450 // (see 'go help build'). 1451 // 1452 // -run regexp 1453 // Run only those tests and examples matching the regular expression. 1454 // For tests the regular expression is split into smaller ones by 1455 // top-level '/', where each must match the corresponding part of a 1456 // test's identifier. 1457 // 1458 // -short 1459 // Tell long-running tests to shorten their run time. 1460 // It is off by default but set during all.bash so that installing 1461 // the Go tree can run a sanity check but not spend time running 1462 // exhaustive tests. 1463 // 1464 // -timeout t 1465 // If a test runs longer than t, panic. 1466 // The default is 10 minutes (10m). 1467 // 1468 // -trace trace.out 1469 // Write an execution trace to the specified file before exiting. 1470 // 1471 // -v 1472 // Verbose output: log all tests as they are run. Also print all 1473 // text from Log and Logf calls even if the test succeeds. 1474 // 1475 // Each of these flags is also recognized with an optional 'test.' prefix, 1476 // as in -test.v. When invoking the generated test binary (the result of 1477 // 'go test -c') directly, however, the prefix is mandatory. 1478 // 1479 // The 'go test' command rewrites or removes recognized flags, 1480 // as appropriate, both before and after the optional package list, 1481 // before invoking the test binary. 1482 // 1483 // For instance, the command 1484 // 1485 // go test -v -myflag testdata -cpuprofile=prof.out -x 1486 // 1487 // will compile the test binary and then run it as 1488 // 1489 // pkg.test -test.v -myflag testdata -test.cpuprofile=prof.out 1490 // 1491 // (The -x flag is removed because it applies only to the go command's 1492 // execution, not to the test itself.) 1493 // 1494 // The test flags that generate profiles (other than for coverage) also 1495 // leave the test binary in pkg.test for use when analyzing the profiles. 1496 // 1497 // When 'go test' runs a test binary, it does so from within the 1498 // corresponding package's source code directory. Depending on the test, 1499 // it may be necessary to do the same when invoking a generated test 1500 // binary directly. 1501 // 1502 // The command-line package list, if present, must appear before any 1503 // flag not known to the go test command. Continuing the example above, 1504 // the package list would have to appear before -myflag, but could appear 1505 // on either side of -v. 1506 // 1507 // To keep an argument for a test binary from being interpreted as a 1508 // known flag or a package name, use -args (see 'go help test') which 1509 // passes the remainder of the command line through to the test binary 1510 // uninterpreted and unaltered. 1511 // 1512 // For instance, the command 1513 // 1514 // go test -v -args -x -v 1515 // 1516 // will compile the test binary and then run it as 1517 // 1518 // pkg.test -test.v -x -v 1519 // 1520 // Similarly, 1521 // 1522 // go test -args math 1523 // 1524 // will compile the test binary and then run it as 1525 // 1526 // pkg.test math 1527 // 1528 // In the first example, the -x and the second -v are passed through to the 1529 // test binary unchanged and with no effect on the go command itself. 1530 // In the second example, the argument math is passed through to the test 1531 // binary, instead of being interpreted as the package list. 1532 // 1533 // 1534 // Description of testing functions 1535 // 1536 // The 'go test' command expects to find test, benchmark, and example functions 1537 // in the "*_test.go" files corresponding to the package under test. 1538 // 1539 // A test function is one named TestXXX (where XXX is any alphanumeric string 1540 // not starting with a lower case letter) and should have the signature, 1541 // 1542 // func TestXXX(t *testing.T) { ... } 1543 // 1544 // A benchmark function is one named BenchmarkXXX and should have the signature, 1545 // 1546 // func BenchmarkXXX(b *testing.B) { ... } 1547 // 1548 // An example function is similar to a test function but, instead of using 1549 // *testing.T to report success or failure, prints output to os.Stdout. 1550 // If the last comment in the function starts with "Output:" then the output 1551 // is compared exactly against the comment (see examples below). If the last 1552 // comment begins with "Unordered output:" then the output is compared to the 1553 // comment, however the order of the lines is ignored. An example with no such 1554 // comment, or with no text after "Output:" is compiled but not executed. 1555 // 1556 // Godoc displays the body of ExampleXXX to demonstrate the use 1557 // of the function, constant, or variable XXX. An example of a method M with 1558 // receiver type T or *T is named ExampleT_M. There may be multiple examples 1559 // for a given function, constant, or variable, distinguished by a trailing _xxx, 1560 // where xxx is a suffix not beginning with an upper case letter. 1561 // 1562 // Here is an example of an example: 1563 // 1564 // func ExamplePrintln() { 1565 // Println("The output of\nthis example.") 1566 // // Output: The output of 1567 // // this example. 1568 // } 1569 // 1570 // Here is another example where the ordering of the output is ignored: 1571 // 1572 // func ExamplePerm() { 1573 // for _, value := range Perm(4) { 1574 // fmt.Println(value) 1575 // } 1576 // 1577 // // Unordered output: 4 1578 // // 2 1579 // // 1 1580 // // 3 1581 // // 0 1582 // } 1583 // 1584 // The entire test file is presented as the example when it contains a single 1585 // example function, at least one other function, type, variable, or constant 1586 // declaration, and no test or benchmark functions. 1587 // 1588 // See the documentation of the testing package for more information. 1589 // 1590 // 1591 package main