You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
487 B
25 lines
487 B
2 years ago
|
//go:build !go1.16
|
||
|
// +build !go1.16
|
||
|
|
||
|
package middleware
|
||
|
|
||
|
import "runtime"
|
||
|
|
||
|
func getNormalizedOSName() (os string) {
|
||
|
switch runtime.GOOS {
|
||
|
case "android":
|
||
|
os = "android"
|
||
|
case "linux":
|
||
|
os = "linux"
|
||
|
case "windows":
|
||
|
os = "windows"
|
||
|
case "darwin":
|
||
|
// Due to Apple M1 we can't distinguish between macOS and iOS when GOOS/GOARCH is darwin/amd64
|
||
|
// For now declare this as "other" until we have a better detection mechanism.
|
||
|
fallthrough
|
||
|
default:
|
||
|
os = "other"
|
||
|
}
|
||
|
return os
|
||
|
}
|