build_constraints_unix

command
v0.5.42 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2025 License: MIT Imports: 1 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL