File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -109,9 +109,11 @@ it is expected to work. It is disabled by default when
109
109
cross-compiling. You can control this by setting the CGO_ENABLED
110
110
environment variable when running the go tool: set it to 1 to enable
111
111
the use of cgo, and to 0 to disable it. The go tool will set the
112
- build constraint "cgo" if cgo is enabled. When the Go tool sees the
113
- special import "C", the "cgo" build constraint will be implied, causing
114
- the tool to skip the file if CGO_ENABLED is set to 0.
112
+ build constraint "cgo" if cgo is enabled. The special import "C"
113
+ implies the "cgo" build constraint, as though the file also said
114
+ "// +build cgo". Therefore, if cgo is disabled, files that import
115
+ "C" will not be built by the go tool.
116
+ (For more about build constraints see https://golang.org/pkg/go/build/#hdr-Build_Constraints).
115
117
116
118
When cross-compiling, you must specify a C cross-compiler for cgo to
117
119
use. You can do this by setting the generic CC_FOR_TARGET or the
You can’t perform that action at this time.
0 commit comments