code.dwrz.net

Go monorepo.
Log | Files | Refs

osname_go115.go (487B)


      1 //go:build !go1.16
      2 // +build !go1.16
      3 
      4 package middleware
      5 
      6 import "runtime"
      7 
      8 func getNormalizedOSName() (os string) {
      9 	switch runtime.GOOS {
     10 	case "android":
     11 		os = "android"
     12 	case "linux":
     13 		os = "linux"
     14 	case "windows":
     15 		os = "windows"
     16 	case "darwin":
     17 		// Due to Apple M1 we can't distinguish between macOS and iOS when GOOS/GOARCH is darwin/amd64
     18 		// For now declare this as "other" until we have a better detection mechanism.
     19 		fallthrough
     20 	default:
     21 		os = "other"
     22 	}
     23 	return os
     24 }