diff --git a/tools/exp/codegen/struct.go b/tools/exp/codegen/struct.go index 9920003..0d6e644 100644 --- a/tools/exp/codegen/struct.go +++ b/tools/exp/codegen/struct.go @@ -2,6 +2,7 @@ package codegen import ( "github.com/dave/jennifer/jen" + "unicode" ) // join appends a bunch of Go Code together, each on their own line. @@ -83,7 +84,9 @@ func (s *Struct) Constructors(name string) *Function { func (s *Struct) ToInterface(pkg, name, comment string) *Interface { fns := make([]FunctionSignature, 0, len(s.methods)) for _, m := range s.methods { - fns = append(fns, m.ToFunctionSignature()) + if unicode.IsUpper([]rune(m.Name())[0]) { + fns = append(fns, m.ToFunctionSignature()) + } } return NewInterface(pkg, name, fns, comment) } diff --git a/tools/exp/codegen/typedef.go b/tools/exp/codegen/typedef.go index ef03334..83a0e9f 100644 --- a/tools/exp/codegen/typedef.go +++ b/tools/exp/codegen/typedef.go @@ -2,6 +2,7 @@ package codegen import ( "github.com/dave/jennifer/jen" + "unicode" ) // Typedef defines a non-struct-based type, its functions, and its methods for @@ -71,7 +72,9 @@ func (t *Typedef) Constructors(name string) *Function { func (t *Typedef) ToInterface(pkg, name, comment string) *Interface { fns := make([]FunctionSignature, 0, len(t.methods)) for _, m := range t.methods { - fns = append(fns, m.ToFunctionSignature()) + if unicode.IsUpper([]rune(m.Name())[0]) { + fns = append(fns, m.ToFunctionSignature()) + } } return NewInterface(pkg, name, fns, comment) }