Skip to content

Commit

Permalink
Don't set the same config value twice
Browse files Browse the repository at this point in the history
  • Loading branch information
sublee committed Aug 9, 2024
1 parent 588f3c0 commit efefb02
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions config/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,10 @@ func parseConverter(ctx *context, rawConverter *RawConverter, global RawLines) (

func initConverter(loader *pkgload.PackageLoader, rawConverter *RawConverter) (*Converter, error) {
c := &Converter{
FileName: rawConverter.FileName,
Package: rawConverter.PackagePath,
Methods: map[string]*Method{},
Location: rawConverter.Converter.Location,
ConverterConfig: DefaultConfigVariables,
FileName: rawConverter.FileName,
Package: rawConverter.PackagePath,
Methods: map[string]*Method{},
Location: rawConverter.Converter.Location,
}

if rawConverter.InterfaceName != "" {
Expand All @@ -123,15 +122,12 @@ func initConverter(loader *pkgload.PackageLoader, rawConverter *RawConverter) (*
return nil, err
}

c.OutputFile = "./generated/generated.go"
c.OutputPackageName = "generated"
c.typ = v.Type()
c.Name = rawConverter.InterfaceName + "Impl"
c.OutputFormat = FormatStruct
return c, nil
}

c.OutputFormat = FormatVariable
c.ConverterConfig = DefaultConfigVariables
c.OutputFile = defaultOutputFile(rawConverter.FileName)
c.OutputPackageName = rawConverter.PackageName
c.OutputPackagePath = rawConverter.PackagePath
Expand Down

0 comments on commit efefb02

Please sign in to comment.