You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can offer the tool mapper as a sort of sibling to stringer. It is part of my maps repo and can be installed using
go get -u github.com/drgrib/maps/cmd/mapper
And used with
mapper -types string:CustomType
To generate the file map_string_customtype.go that infers its package from surrounding .go files or the current folder name if no other files are found:
I've never contributed to the go code base so I'm not sure how this all works but am happy to make this code part of the core project, which may be useful until we get generics in Go 2.0.
The text was updated successfully, but these errors were encountered:
Our usual procedure would be to make the tool available in your own repo, as you've done, and see how much pick-up it gets. If a lot of other projects start using it it will make sense to consider adding it to the x/tools repo.
andybons
changed the title
x/tools/cmd/mapper - Feature offer
proposal: add x/tools/cmd/mapper
Feb 6, 2019
I can offer the tool
mapper
as a sort of sibling tostringer
. It is part of mymaps
repo and can be installed usingAnd used with
To generate the file
map_string_customtype.go
that infers itspackage
from surrounding.go
files or the current folder name if no other files are found:I've never contributed to the
go
code base so I'm not sure how this all works but am happy to make this code part of the core project, which may be useful until we get generics in Go 2.0.The text was updated successfully, but these errors were encountered: