github.com/nilium/gitlab-runner@v12.5.0+incompatible/helpers/docker/errors/errors.go (about) 1 package errors 2 3 import ( 4 "fmt" 5 ) 6 7 // ErrOSNotSupported is used when docker does not support the detected OSType. 8 // NewErrOSNotSupported is used to initialize this type. 9 type ErrOSNotSupported struct { 10 detectedOSType string 11 } 12 13 func (e *ErrOSNotSupported) Error() string { 14 return fmt.Sprintf("unsupported OSType %q", e.detectedOSType) 15 } 16 17 // NewErrOSNotSupported creates a ErrOSNotSupported for the specified OSType. 18 func NewErrOSNotSupported(osType string) *ErrOSNotSupported { 19 return &ErrOSNotSupported{ 20 detectedOSType: osType, 21 } 22 }