github.com/circl-dev/go-swagger@v0.31.0/cmd/swagger/commands/generate/contrib.go (about)

     1  package generate
     2  
     3  import (
     4  	"github.com/circl-dev/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  }