@@ -220,37 +220,6 @@ func (s Syrup) writeReturnsFnCaller(w *Writer, argNames []string, params, result
220220 }
221221}
222222
223- func (s Syrup ) createFuncSignature (params , results * types.Tuple ) string {
224- fnSign := "func("
225- for i := 0 ; i < params .Len (); i ++ {
226- param := params .At (i )
227- if param .Type ().String () == contextType {
228- continue
229- }
230-
231- fnSign += s .getTypeName (param .Type (), i == params .Len ()- 1 )
232-
233- if i + 1 < params .Len () {
234- fnSign += ", "
235- }
236- }
237- fnSign += ") "
238-
239- if results != nil {
240- fnSign += "("
241- for i := 0 ; i < results .Len (); i ++ {
242- rType := results .At (i ).Type ()
243- fnSign += s .getTypeName (rType , false )
244- if i + 1 < results .Len () {
245- fnSign += ", "
246- }
247- }
248- fnSign += ")"
249- }
250-
251- return fnSign
252- }
253-
254223func (s Syrup ) methodOn (writer io.Writer ) error {
255224 w := & Writer {writer : writer }
256225
@@ -651,6 +620,37 @@ func (s Syrup) getTupleTypes(t *types.Tuple) []string {
651620 return tupleTypes
652621}
653622
623+ func (s Syrup ) createFuncSignature (params , results * types.Tuple ) string {
624+ fnSign := "func("
625+ for i := 0 ; i < params .Len (); i ++ {
626+ param := params .At (i )
627+ if param .Type ().String () == contextType {
628+ continue
629+ }
630+
631+ fnSign += s .getTypeName (param .Type (), i == params .Len ()- 1 )
632+
633+ if i + 1 < params .Len () {
634+ fnSign += ", "
635+ }
636+ }
637+ fnSign += ") "
638+
639+ if results != nil {
640+ fnSign += "("
641+ for i := 0 ; i < results .Len (); i ++ {
642+ rType := results .At (i ).Type ()
643+ fnSign += s .getTypeName (rType , false )
644+ if i + 1 < results .Len () {
645+ fnSign += ", "
646+ }
647+ }
648+ fnSign += ")"
649+ }
650+
651+ return fnSign
652+ }
653+
654654func writeImports (writer io.Writer , descPkg PackageDesc ) error {
655655 base := template .New ("templateImports" )
656656
0 commit comments