gospecific
Avoid using generic packages with interface{}
by generating specific
packages that can be used with safe types.
Usage
Install gospecific
go get github.com/ernesto-jimenez/gogen/cmd/gospecific
Add a go generate comment to generate a package
//go:generate gospecific -pkg=container/list -specific-type=string
Generate the code
go generate
Now you will have your own list
package to store strings rather than
interface{}
% godoc github.com/ernesto-jimenez/gogen/list | egrep 'func.+string'
func (l *List) InsertAfter(v string, mark *Element) *Element
func (l *List) InsertBefore(v string, mark *Element) *Element
func (l *List) PushBack(v string) *Element
func (l *List) PushFront(v string) *Element
func (l *List) Remove(e *Element) string