fix go vet nits

master
Felix Lange 8 years ago
parent 788895d3d8
commit 2bc71e15d7
  1. 4
      main.go

@ -200,7 +200,7 @@ func (cfg *Config) process() (code []byte, err error) {
opt := &imports.Options{Comments: true, TabIndent: true, TabWidth: 8}
code, err = imports.Process("", code, opt)
if err != nil {
panic(fmt.Errorf("BUG: can't gofmt generated code:", err))
panic(fmt.Errorf("BUG: can't gofmt generated code: %v", err))
}
return code, nil
}
@ -226,7 +226,7 @@ func loadPackage(cfg *Config) (*types.Package, error) {
func generate(mtyp *marshalerType, cfg *Config) ([]byte, error) {
w := new(bytes.Buffer)
fmt.Fprintln(w, "// generated by gencodec, do not edit.\n")
fmt.Fprint(w, "// generated by gencodec, do not edit.\n\n")
fmt.Fprintln(w, "package", mtyp.orig.Obj().Pkg().Name())
fmt.Fprintln(w)
mtyp.scope.writeImportDecl(w)

Loading…
Cancel
Save