Implement constructors

This commit is contained in:
2024-09-12 00:45:41 +02:00
parent 440a6e33e6
commit ece38cda72
2 changed files with 18 additions and 2 deletions

11
main.go
View File

@@ -77,6 +77,17 @@ func main() {
Comment: "test method",
},
},
Constructors: []Constructor{
{
Params: []Param{},
},
{
Params: []Param{
{Name: "a", Type: "int", Comment: "test param 1"},
{Name: "b", Type: "string", Comment: "test param 2"},
},
},
},
}
ltemplate, err := template.New("class").Funcs(fns).Parse(templatestr)