image_os.go 385 B

123456789101112131415
  1. package system
  2. import (
  3. "errors"
  4. "runtime"
  5. "strings"
  6. )
  7. // ErrNotSupportedOperatingSystem means the operating system is not supported.
  8. var ErrNotSupportedOperatingSystem = errors.New("operating system is not supported")
  9. // IsOSSupported determines if an operating system is supported by the host.
  10. func IsOSSupported(os string) bool {
  11. return strings.EqualFold(runtime.GOOS, os)
  12. }