cheekybits / genny

Elegant generics for Go
MIT License
1.71k stars 167 forks source link

fix: detect identifiers in comments using regex, not strings.Fields #62

Open p4l1ly opened 4 years ago

p4l1ly commented 4 years ago

With substitution "SomeThing=int", the comment // foo=SomeThing,OtherThing was being changed to // foo=Int,OtherThing. The capital I is a problem. This fix resolves the problem. I've used regex directly instead of go/parser because it would fail inside comments (didn't try).