by bakul · 8y ago · 0 comments
package stack[t]
type Type []t
func New() Type { return Type{} }
...
Then it can be used so: import s “stack”[int]
var s1 = s.New()I made gotemplate to explore that idea
https://github.com/ncw/gotemplate
This requires a round of `go generate` for the actual code generation, but otherwise quite a similar experience.
Having it built in would be great!