@@ -132,6 +132,7 @@ func (p *Func) End(cb *CodeBuilder, src ast.Node) {
132
132
}
133
133
}
134
134
135
+ // NewFuncDecl creates a new function without function body (declaration only).
135
136
func (p * Package ) NewFuncDecl (pos token.Pos , name string , sig * types.Signature ) * Func {
136
137
f , err := p .NewFuncWith (pos , name , sig , nil )
137
138
if err != nil {
@@ -142,7 +143,7 @@ func (p *Package) NewFuncDecl(pos token.Pos, name string, sig *types.Signature)
142
143
return f
143
144
}
144
145
145
- // NewFunc func
146
+ // NewFunc creates a new function (should have a function body).
146
147
func (p * Package ) NewFunc (recv * Param , name string , params , results * Tuple , variadic bool ) * Func {
147
148
sig := types .NewSignatureType (recv , nil , nil , params , results , variadic )
148
149
f , err := p .NewFuncWith (token .NoPos , name , sig , nil )
@@ -159,7 +160,7 @@ func getRecv(recvTypePos func() token.Pos) token.Pos {
159
160
return token .NoPos
160
161
}
161
162
162
- // NewFuncWith func
163
+ // NewFuncWith creates a new function (should have a function body).
163
164
func (p * Package ) NewFuncWith (
164
165
pos token.Pos , name string , sig * types.Signature , recvTypePos func () token.Pos ) (* Func , error ) {
165
166
if name == "" {
0 commit comments