Merge pull request #7403 from kit-ty-kate/freebsd-arm64

Fix "getCPUInfo for OS freebsd: not implemented" on FreeBSD/arm64
This commit is contained in:
Kazuyoshi Kato 2022-11-04 10:22:30 -07:00 committed by GitHub
commit 88dc30af12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,6 +94,19 @@ func getCPUVariant() string {
return variant return variant
} }
if runtime.GOOS == "freebsd" {
// FreeBSD supports ARMv6 and ARMv7 as well as ARMv4 and ARMv5 (though deprecated)
// detecting those variants is currently unimplemented
var variant string
switch runtime.GOARCH {
case "arm64":
variant = "v8"
default:
variant = "unknown"
}
return variant
}
variant, err := getCPUInfo("Cpu architecture") variant, err := getCPUInfo("Cpu architecture")
if err != nil { if err != nil {