diff --git a/typewriter/app.go b/typewriter/app.go index 55f2bc6..f7afe46 100644 --- a/typewriter/app.go +++ b/typewriter/app.go @@ -91,7 +91,7 @@ func (a *app) WriteAll() error { var b bytes.Buffer write(&b, a, t, tw) // will append _test to file name if the source type is in a _test.go file - f := strings.ToLower(fmt.Sprintf("%s_%s%s.go", t.LocalName(), tw.Name(), t.test)) + f := strings.ToLower(fmt.Sprintf("%s_%s%s.go", t.Name, tw.Name(), t.test)) buffers[f] = &b } } diff --git a/typewriter/package.go b/typewriter/package.go index 69c9009..b3b91b6 100644 --- a/typewriter/package.go +++ b/typewriter/package.go @@ -3,6 +3,7 @@ package typewriter import ( "go/ast" "go/token" + "strings" _ "code.google.com/p/go.tools/go/gcimporter" "code.google.com/p/go.tools/go/types" @@ -43,7 +44,7 @@ func (p *Package) Eval(name string) (result Type, err error) { result = Type{ Package: p, Pointer: isPointer(t), - Name: name, + Name: strings.TrimLeft(name, Pointer(true).String()), // trims the * if it exists comparable: isComparable(t), numeric: isNumeric(t), ordered: isOrdered(t),