diff --git a/main.go b/main.go index 5ac3429..486cd53 100644 --- a/main.go +++ b/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 { - 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 } diff --git a/typeutil.go b/typeutil.go index 84c8755..99337f4 100644 --- a/typeutil.go +++ b/typeutil.go @@ -33,7 +33,7 @@ func walkNamedTypes(typ types.Type, callback func(*types.Named)) { walkNamedTypes(typ.Field(i).Type(), callback) } default: - panic(fmt.Errorf("can't walk %T", typ)) + panic(fmt.Errorf("BUG: can't walk %T", typ)) } }