genny/resource/options.go
func (opts *Options) Validate() error {
	if opts.App.IsZero() {
		opts.App = meta.New(".")
	}

	if len(opts.Name) == 0 {
		return errors.New("you must provide a name")
	}

	if len(opts.Model) == 0 {
		opts.Model = opts.Name
	}

	if strings.Contains(opts.Model, "/") {
		parts := strings.Split(opts.Model, "/")
		opts.Model = parts[len(parts)-1]
	}

	if opts.App.AsAPI {
		opts.SkipTemplates = true
	}

	return nil
}
func (opts *Options) Validate() error {
	if opts.App.IsZero() {
		opts.App = meta.New(".")
	}

	if len(opts.Name) == 0 {
		return errors.New("you must provide a name")
	}

	if len(opts.Model) == 0 {
		opts.Model = opts.Name
	}

	if strings.Contains(opts.Model, "/") {
		parts := strings.Split(opts.Model, "/")
		opts.Model = parts[len(parts)-1]
	}

	if opts.App.AsAPI {
		opts.SkipTemplates = true
	}

	return nil
}
func ( opts * Options ) Validate ( ) error { if opts . App . IsZero ( ) { opts . App = meta . New ( " " ) } if len ( opts . Name ) == 0 { return errors . New ( " " ) } if len ( opts . Model ) == 0 { opts . Model = opts . Name } if strings . Contains ( opts . Model , " " ) { parts := strings . Split ( opts . Model , " " ) opts . Model = parts [ len ( parts ) - 1 ] } if opts . App . AsAPI { opts . SkipTemplates = true } return nil }
// Validate that options are usuable
Validate that options are usuable