cmd: Add --output_file_prefix, which sets a prefix for the output file name "wire_gen.go"
This commit is contained in:
committed by
Robert van Gent
parent
c385f07c5d
commit
55a93fac11
@@ -63,7 +63,8 @@ func (gen GenerateResult) Commit() error {
|
||||
// GenerateOptions holds options for Generate.
|
||||
type GenerateOptions struct {
|
||||
// Header will be inserted at the start of each generated file.
|
||||
Header []byte
|
||||
Header []byte
|
||||
PrefixOutputFile string
|
||||
}
|
||||
|
||||
// Generate performs dependency injection for the packages that match the given
|
||||
@@ -94,7 +95,7 @@ func Generate(ctx context.Context, wd string, env []string, patterns []string, o
|
||||
generated[i].Errs = append(generated[i].Errs, err)
|
||||
continue
|
||||
}
|
||||
generated[i].OutputPath = filepath.Join(outDir, "wire_gen.go")
|
||||
generated[i].OutputPath = filepath.Join(outDir, opts.PrefixOutputFile+"wire_gen.go")
|
||||
g := newGen(pkg)
|
||||
injectorFiles, errs := generateInjectors(g, pkg)
|
||||
if len(errs) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user