in files.go [53:80]
func (s *SourceInline) validate(subpath string) (retErr error) {
var errs []error
if s.File == nil && s.Dir == nil {
errs = append(errs, errors.New("inline source is missing contents to inline"))
}
if s.File != nil && s.Dir != nil {
errs = append(errs, errors.New("inline source variant cannot have both a file and dir set"))
}
if s.Dir != nil {
if err := s.Dir.validate(); err != nil {
errs = append(errs, err)
}
}
if s.File != nil {
if subpath != "" {
errs = append(errs, errors.New("inline file source cannot have a path set"))
}
if err := s.File.validate(); err != nil {
errs = append(errs, err)
}
}
return goerrors.Join(errs...)
}