blob: 2f061e2ae314c8a837f2beac2aae12811c41bad4 [file]
package image
import (
"errors"
"runtime"
"strings"
"github.com/moby/moby/v2/errdefs"
)
// CheckOS checks if the given OS matches the host's platform, and
// returns an error otherwise.
func CheckOS(os string) error {
if !strings.EqualFold(runtime.GOOS, os) {
return errdefs.InvalidParameter(errors.New("operating system is not supported"))
}
return nil
}