A code generation helper.
Wrapper library around golang.org/x/tools/go/packages
to filter only defined types and their dependencies.
package main
import (
"github.com/foomo/gocontemplate/pkg/contemplate"
)
func main() {
ctpl, err := contemplate.Load(&contemplate.Config{
Packages: []*contemplate.PackageConfig{
{
Path: "github.com/foomo/sesamy-go/event",
Types: []string{"PageView"},
},
},
})
if err != nil {
panic(err)
}
}
Make a pull request...
Distributed under MIT License, please see license file within the code for more details.