// they are treated as a single package. Within a package, generate processes the
// source files in a package in file name order, one at a time. Within
// a source file, generate runs generators in the order they appear
-// in the file, one at a time.
+// in the file, one at a time. The go generate tool also sets the build
+// tag "generate" so that files may be examined by go generate but ignored
+// during build.
//
// If any generator returns an error exit status, "go generate" skips
// all further processing for that package.
they are treated as a single package. Within a package, generate processes the
source files in a package in file name order, one at a time. Within
a source file, generate runs generators in the order they appear
-in the file, one at a time.
+in the file, one at a time. The go generate tool also sets the build
+tag "generate" so that files may be examined by go generate but ignored
+during build.
If any generator returns an error exit status, "go generate" skips
all further processing for that package.
log.Fatalf("generate: %s", err)
}
}
+
+ cfg.BuildContext.BuildTags = append(cfg.BuildContext.BuildTags, "generate")
+
// Even if the arguments are .go files, this loop suffices.
printed := false
for _, pkg := range load.Packages(args) {
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// +build generate
+
package windows
//go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go syscall_windows.go security_windows.go psapi_windows.go symlink_windows.go