MCPcopy Index your code
hub / github.com/php/frankenphp / extractGoFunctionCallParams

Function extractGoFunctionCallParams

internal/extgen/gofile.go:215–245  ·  view source on GitHub ↗

extractGoFunctionCallParams extracts just the parameter names for calling a function.

(goFunction string)

Source from the content-addressed store, hash-verified

213
214// extractGoFunctionCallParams extracts just the parameter names for calling a function.
215func extractGoFunctionCallParams(goFunction string) string {
216 params := extractGoFunctionSignatureParams(goFunction)
217 if params == "" {
218 return ""
219 }
220
221 var names []string
222 parts := strings.Split(params, ",")
223 for _, part := range parts {
224 part = strings.TrimSpace(part)
225 if len(part) == 0 {
226 continue
227 }
228
229 words := strings.Fields(part)
230 if len(words) > 0 {
231 names = append(names, words[0])
232 }
233 }
234
235 var result strings.Builder
236 for i, name := range names {
237 if i > 0 {
238 result.WriteString(", ")
239 }
240
241 result.WriteString(name)
242 }
243
244 return result.String()
245}

Callers 1

Calls 3

WriteStringMethod · 0.80
StringMethod · 0.45

Tested by 1