github.com/brycereitano/goa@v0.0.0-20170315073847-8ffa6c85e265/goagen/gen_app/options.go (about) 1 package genapp 2 3 import "github.com/goadesign/goa/design" 4 5 //Option a generator option definition 6 type Option func(*Generator) 7 8 //API The API definition 9 func API(API *design.APIDefinition) Option { 10 return func(g *Generator) { 11 g.API = API 12 } 13 } 14 15 //OutDir Path to output directory 16 func OutDir(outDir string) Option { 17 return func(g *Generator) { 18 g.OutDir = outDir 19 } 20 } 21 22 //Target Name of generated package 23 func Target(target string) Option { 24 return func(g *Generator) { 25 g.Target = target 26 } 27 } 28 29 //NoTest Whether to skip test generation 30 func NoTest(noTest bool) Option { 31 return func(g *Generator) { 32 g.NoTest = noTest 33 } 34 }