Merge pull request #2700 from jiria/jiria/add-windows-arm-support

Add support to detect ARM variant on Windows
This commit is contained in:
Derek McGowan 2018-10-10 16:47:54 -07:00 committed by GitHub
commit f67459929e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,6 +74,22 @@ func getCPUInfo(pattern string) (info string, err error) {
} }
func getCPUVariant() string { func getCPUVariant() string {
if runtime.GOOS == "windows" {
// Windows only supports v7 for ARM32 and v8 for ARM64 and so we can use
// runtime.GOARCH to determine the variants
var variant string
switch runtime.GOARCH {
case "arm64":
variant = "v8"
case "arm":
variant = "v7"
default:
variant = "unknown"
}
return variant
}
variant, err := getCPUInfo("Cpu architecture") variant, err := getCPUInfo("Cpu architecture")
if err != nil { if err != nil {
log.L.WithError(err).Error("failure getting variant") log.L.WithError(err).Error("failure getting variant")