package customgen
import (
"go/ast"
"go/types"
"github.com/octohelm/gengo/pkg/gengo"
)
func init() {
gengo.Register(&customGen{})
}
type customGen struct {
}
func (*customGen) Name() string {
return "custom"
}
func (g *customGen) GenerateType(c gengo.Context, named *types.Named) error {
if !ast.IsExported(named.Obj().Name()) {
// skip type
return gengo.ErrSkip
}
if whenSomeThing() {
// end generate but ignore error
return gengo.ErrIgnore
}
// do generate
return nil
}
-
Notifications
You must be signed in to change notification settings - Fork 0
License
octohelm/gengo
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published