github.com/josephspurrier/go-swagger@v0.2.1-0.20221129144919-1f672a142a00/cmd/swagger/commands/generate/contrib.go (about)

     1  package generate
     2  
     3  import (
     4  	"github.com/go-swagger/go-swagger/generator"
     5  )
     6  
     7  // contribOptionsOverride gives contributed templates the ability to override the options if they need
     8  func contribOptionsOverride(opts *generator.GenOpts) {
     9  	// nolint: gocritic
    10  	switch opts.Template {
    11  	case "stratoscale":
    12  		// Stratoscale template needs to regenerate the configureapi on every run.
    13  		opts.RegenerateConfigureAPI = true
    14  		// It also does not use the main.go
    15  		opts.IncludeMain = false
    16  	}
    17  }