add missing BUG: in panic calls

master
Felix Lange 8 years ago
parent 265175060b
commit ce9e87e161
  1. 2
      main.go
  2. 2
      typeutil.go

@ -200,7 +200,7 @@ func (cfg *Config) process() (code []byte, err error) {
opt := &imports.Options{Comments: true, TabIndent: true, TabWidth: 8} opt := &imports.Options{Comments: true, TabIndent: true, TabWidth: 8}
code, err = imports.Process("", code, opt) code, err = imports.Process("", code, opt)
if err != nil { if err != nil {
return code, fmt.Errorf("can't gofmt generated code:", err, "\n"+string(code)) panic(fmt.Errorf("BUG: can't gofmt generated code:", err))
} }
return code, nil return code, nil
} }

@ -33,7 +33,7 @@ func walkNamedTypes(typ types.Type, callback func(*types.Named)) {
walkNamedTypes(typ.Field(i).Type(), callback) walkNamedTypes(typ.Field(i).Type(), callback)
} }
default: default:
panic(fmt.Errorf("can't walk %T", typ)) panic(fmt.Errorf("BUG: can't walk %T", typ))
} }
} }

Loading…
Cancel
Save