{"record":{"id":"dd6beb9dfe3f44bb","repo":"go-delve/delve","slug":"not-enough-arguments-to-s","errorCode":null,"errorMessage":"not enough arguments to %s","messagePattern":"not enough arguments to (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/eval.go","lineNumber":2100,"sourceCode":"\t\t}\n\n\t\t_, err := negotiateType(op, args[i], best)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tv, err := compareOp(op, args[i], best)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tif v {\n\t\t\tbest = args[i]\n\t\t}\n\t}\n\n\tif best == nil {\n\t\treturn nil, fmt.Errorf(\"not enough arguments to %s\", name)\n\t}\n\treturn best, nil\n}\n\n// Evaluates expressions <subexpr>.<field name> where subexpr is not a package name\nfunc (scope *EvalScope) evalStructSelector(op *evalop.Select, stack *evalStack) {\n\txv := stack.pop()\n\t// Prevent abuse, attempting to call \"nil.member\" directly.\n\tif xv.Addr == 0 && xv.Name == \"nil\" {\n\t\tstack.err = fmt.Errorf(\"%s (type %s) is not a struct\", xv.Name, xv.TypeString())\n\t\treturn\n\t}\n\t// Prevent abuse, attempting to call \"\\\"fake\\\".member\" directly.\n\tif xv.Addr == 0 && xv.Name == \"\" && xv.DwarfType == nil && xv.RealType == nil {\n\t\tstack.err = fmt.Errorf(\"%s (type %s) is not a struct\", xv.Value, xv.TypeString())\n\t\treturn\n\t}\n\t// Special type conversions for CPU register variables (REGNAME.int8, etc)","sourceCodeStart":2082,"sourceCodeEnd":2118,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/eval.go#L2082-L2118","documentation":"After evaluating all argument expressions for a function call, Delve picks the argument whose truthiness selects the overload/branch. If no argument was selected (best == nil) the call does not have enough arguments, so evaluation of the call fails with this error naming the function.","triggerScenarios":"Issuing a 'call <name>(...)' expression with fewer arguments than the function requires; also hit when all argument evaluations produced non-selected (false) values in the selection logic preceding the check at eval.go:2100.","commonSituations":"Typos or omitted arguments when calling methods from the debugger prompt, e.g. 'call fmt.Printf(\"%d\")' without the value, or calling a method with receiver arguments missed.","solutions":["Supply all required arguments in the call expression, matching the function signature.","Use 'print <fn>' or check the function signature in the source to count required parameters.","For variadic or defaulted-style usage, pass explicit zero values for missing arguments.","If calling a method, ensure the receiver expression is included correctly in the call syntax."],"exampleFix":"// before\ndlv> call fmt.Sprintf(\"%d-%s\")\n// error: not enough arguments to fmt.Sprintf\n// after\ndlv> call fmt.Sprintf(\"%d-%s\", 42, \"x\")","handlingStrategy":"validation","validationCode":"// Count required params before calling; in the CLI:\n// dlv> print fmt.Sprintf   // inspect signature first\n// Or check the source signature matches the number of args supplied.","typeGuard":null,"tryCatchPattern":"res, err := scope.EvalExpression(callExpr, cfg)\nif err != nil && strings.Contains(err.Error(), \"not enough arguments to\") {\n    // rebuild the call expression with all required arguments\n}","preventionTips":["check the function signature before writing a call expression","supply explicit zero values for omitted arguments","count format-verb arguments for fmt functions","include method receivers correctly in call syntax"],"tags":["debugger","go","function-call","argument-count"],"backgroundTag":"wrong-argument-count","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}