Skip to content

Commit f674599

Browse files
authoredOct 10, 2018
Merge pull request #2700 from jiria/jiria/add-windows-arm-support
Add support to detect ARM variant on Windows
2 parents 31aa418 + e6529f4 commit f674599

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
 

‎platforms/cpuinfo.go

+16
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,22 @@ func getCPUInfo(pattern string) (info string, err error) {
7474
}
7575

7676
func getCPUVariant() string {
77+
if runtime.GOOS == "windows" {
78+
// Windows only supports v7 for ARM32 and v8 for ARM64 and so we can use
79+
// runtime.GOARCH to determine the variants
80+
var variant string
81+
switch runtime.GOARCH {
82+
case "arm64":
83+
variant = "v8"
84+
case "arm":
85+
variant = "v7"
86+
default:
87+
variant = "unknown"
88+
}
89+
90+
return variant
91+
}
92+
7793
variant, err := getCPUInfo("Cpu architecture")
7894
if err != nil {
7995
log.L.WithError(err).Error("failure getting variant")

0 commit comments

Comments
 (0)