image_os_deprecated.go 571 B

12345678910111213141516171819
  1. package system
  2. import (
  3. "errors"
  4. "runtime"
  5. "strings"
  6. )
  7. // ErrNotSupportedOperatingSystem means the operating system is not supported.
  8. //
  9. // Deprecated: use [github.com/docker/docker/image.CheckOS] and check the error returned.
  10. var ErrNotSupportedOperatingSystem = errors.New("operating system is not supported")
  11. // IsOSSupported determines if an operating system is supported by the host.
  12. //
  13. // Deprecated: use [github.com/docker/docker/image.CheckOS] and check the error returned.
  14. func IsOSSupported(os string) bool {
  15. return strings.EqualFold(runtime.GOOS, os)
  16. }