Skip to content

Commit

Permalink
type name and file name should not have pointer
Browse files Browse the repository at this point in the history
resolves #63
  • Loading branch information
clipperhouse committed Aug 8, 2014
1 parent 2c662d8 commit b6ba7bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion typewriter/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
3 changes: 2 additions & 1 deletion typewriter/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit b6ba7bc

Please sign in to comment.