Documentation
¶
Overview ¶
Go 1.19 で Build Constraints に新たに unix が追加された。
実際のマッピングは $(go env GOROOT)/src/cmd/dist/build.go に以下のように定義されている。(Go 1.25)
var unixOS = map[string]bool{
"aix": true,
"android": true,
"darwin": true,
"dragonfly": true,
"freebsd": true,
"hurd": true,
"illumos": true,
"ios": true,
"linux": true,
"netbsd": true,
"openbsd": true,
"solaris": true,
}
なので、linux, macOS(darwin) の両方で有効にする場合は unix を指定すれば良い。
REFERENCES ¶
Click to show internal directories.
Click to hide internal directories.