Go: not enough arguments in call to f have (int) want (int, string)
A function was called with fewer or more arguments than it declares.
not enough arguments in call totoo many arguments in call tohave (int) want (int, string)not enough arguments to returntoo many return values Meaning
Compare the call with the function signature; the error shows have and want. After changing a function signature, update all call sites. For variadic functions use args... to pass a slice.
Common causes
- Signature changed but callers not updated
- Forgot an argument (context.Context, error handling)
- Extra argument passed
- Method vs function confusion
- Variadic slice not expanded
⚡ Quick fix
- Match the call to
want (…) - Update all callers after changing the signature
- Use
f(items...)for variadic parameters
Detailed fix by platform
Go
- Use
goplsrename/change-signature refactoring in your editor to update call sites
How to diagnose
- Have/want — Compare lists?
- Signature — Recently changed?
- Variadic — Expanded?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- assignment mismatch: 1 variable but f returns 2 values Go: assignment mismatch: 1 variable but os.Open returns 2 values
- cannot assign to struct field m[k].f in map Go: cannot assign to struct field users["bob"].Age in map
- cannot use x as type in assignment/argument Go: cannot use "5" (untyped string constant) as int value in argument to f
Most viewed in Go
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 4 Nov 2026