extractGoFunctionName extracts the Go function name from a Go function signature string.
(goFunction string)
| 130 | |
| 131 | // extractGoFunctionName extracts the Go function name from a Go function signature string. |
| 132 | func extractGoFunctionName(goFunction string) string { |
| 133 | idx := strings.Index(goFunction, "func ") |
| 134 | if idx == -1 { |
| 135 | return "" |
| 136 | } |
| 137 | |
| 138 | start := idx + len("func ") |
| 139 | |
| 140 | end := start |
| 141 | for end < len(goFunction) && goFunction[end] != '(' { |
| 142 | end++ |
| 143 | } |
| 144 | |
| 145 | if end >= len(goFunction) { |
| 146 | return "" |
| 147 | } |
| 148 | |
| 149 | return strings.TrimSpace(goFunction[start:end]) |
| 150 | } |
| 151 | |
| 152 | // extractGoFunctionSignatureParams extracts the parameters from a Go function signature. |
| 153 | func extractGoFunctionSignatureParams(goFunction string) string { |
no outgoing calls