{"record":{"id":"e7d128bae55dc89f","repo":"go-delve/delve","slug":"unknown-argument-q","errorCode":null,"errorMessage":"unknown argument %q","messagePattern":"unknown argument %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/terminal/starbind/starlark_mapping.go","lineNumber":910,"sourceCode":"\t\t\tif err != nil {\n\t\t\t\treturn starlark.None, decorateError(thread, err)\n\t\t\t}\n\t\t}\n\t\tif len(args) > 1 && args[1] != starlark.None {\n\t\t\terr := unmarshalStarlarkValue(args[1], &rpcArgs.Name, \"Name\")\n\t\t\tif err != nil {\n\t\t\t\treturn starlark.None, decorateError(thread, err)\n\t\t\t}\n\t\t}\n\t\tfor _, kv := range kwargs {\n\t\t\tvar err error\n\t\t\tswitch kv[0].(starlark.String) {\n\t\t\tcase \"Id\":\n\t\t\t\terr = unmarshalStarlarkValue(kv[1], &rpcArgs.Id, \"Id\")\n\t\t\tcase \"Name\":\n\t\t\t\terr = unmarshalStarlarkValue(kv[1], &rpcArgs.Name, \"Name\")\n\t\t\tdefault:\n\t\t\t\terr = fmt.Errorf(\"unknown argument %q\", kv[0])\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn starlark.None, decorateError(thread, err)\n\t\t\t}\n\t\t}\n\t\terr := env.ctx.Client().CallAPI(\"GetBreakpoint\", &rpcArgs, &rpcRet)\n\t\tif err != nil {\n\t\t\treturn starlark.None, err\n\t\t}\n\t\treturn env.interfaceToStarlarkValue(&rpcRet), nil\n\t})\n\tdoc[\"get_breakpoint\"] = \"builtin get_breakpoint(Id, Name)\\n\\nget_breakpoint gets a breakpoint by Name (if Name is not an empty string) or by ID.\"\n\tr[\"get_buffered_tracepoints\"] = starlark.NewBuiltin(\"get_buffered_tracepoints\", func(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error) {\n\t\tif err := isCancelled(thread); err != nil {\n\t\t\treturn starlark.None, decorateError(thread, err)\n\t\t}\n\t\tvar rpcArgs rpc2.GetBufferedTracepointsIn\n\t\tvar rpcRet rpc2.GetBufferedTracepointsOut","sourceCodeStart":892,"sourceCodeEnd":928,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/terminal/starbind/starlark_mapping.go#L892-L928","documentation":"The generated starlark binding for the GetBreakpoint RPC accepts only whitelisted keyword arguments (here `Id` and `Name`); any other kwarg produces this error before any RPC is made. The message quotes the offending keyword name via %q on the starlark value.","triggerScenarios":"Calling `debug.GetBreakpoint(Id=..., SomeOther=...)` with a keyword not in the switch (anything other than \"Id\" or \"Name\").","commonSituations":"Script authors guessing parameter names (e.g. `File`, `Line`) or copying kwargs from a different API call like CreateBreakpoint into GetBreakpoint.","solutions":["Use only supported kwargs: Id, Name — see the rpc2 GetBreakpointIn type for the full call contract.","To find a breakpoint by location, create/set the breakpoint first or use ListBreakpoints and filter.","Check generated binding source in pkg/terminal/starbind/starlark_mapping.go for the accepted keys."],"exampleFix":"// before (starlark)\ndebug.GetBreakpoint(File=\"main.go\", Line=10)\n// after\ndebug.GetBreakpoint(Id=1)","handlingStrategy":"validation","validationCode":"# starlark: only Id and Name are accepted\nbp = debug.GetBreakpoint(Id=1)\n# or\nbp = debug.GetBreakpoint(Name=\"mybp\")","typeGuard":"// Go-side guard on kwargs before building the call:\nfunc validGetBreakpointKw(k string) bool {\n    switch k {\n    case \"Id\", \"Name\":\n        return true\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Check the rpc2 In-struct fields for each API before scripting","Reuse kwargs copied from the same API, not from neighboring APIs","Search starlark_mapping.go for the switch cases of the binding"],"tags":["go","starlark","rpc","argument-validation"],"backgroundTag":"unknown-keyword-argument","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}