for _, target := range gooses {
var buf bytes.Buffer
fmt.Fprintf(&buf, "// generated by gengoos.go using 'go generate'\n\n")
- fmt.Fprintf(&buf, "// +build %s\n\n", target) // usually redundant, but not always; see linux vs android
+ if target == "linux" {
+ fmt.Fprintf(&buf, "// +build !android\n\n") // must explicitly exclude android for linux
+ }
fmt.Fprintf(&buf, "package runtime\n\n")
fmt.Fprintf(&buf, "const theGoos = `%s`\n\n", target)
for _, goos := range gooses {