From ce9e87e16119ed4121c2483325eb0b8318c00ebe Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Mon, 6 Mar 2017 23:05:04 +0100 Subject: [PATCH] add missing BUG: in panic calls --- main.go | 2 +- typeutil.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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)) } }