blob: ff4fe36d3a58742c85d6f3b40133e15ac02fb7f1 [file] [log] [blame]
package image
import (
"errors"
"runtime"
"strings"
"github.com/docker/docker/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
}