gospecific

command
v0.0.0-...-d7d4131 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2018 License: MIT Imports: 3 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL