github.com/gernest/nezuko@v0.1.2/internal/sys/supported.go (about) 1 // Copyright 2018 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package sys 6 7 // RaceDetectorSupported reports whether goos/goarch supports the race 8 // detector. There is a copy of this function in cmd/dist/test.go. 9 func RaceDetectorSupported(goos, goarch string) bool { 10 switch goos { 11 case "linux": 12 return goarch == "amd64" || goarch == "ppc64le" || goarch == "arm64" 13 case "darwin", "freebsd", "netbsd", "windows": 14 return goarch == "amd64" 15 default: 16 return false 17 } 18 } 19 20 // MSanSupported reports whether goos/goarch supports the memory 21 // sanitizer option. There is a copy of this function in cmd/dist/test.go. 22 func MSanSupported(goos, goarch string) bool { 23 switch goos { 24 case "linux": 25 return goarch == "amd64" || goarch == "arm64" 26 default: 27 return false 28 } 29 }