{"record":{"id":"232638fb17600f46","repo":"golang/go","slug":"unknown-s-q","errorCode":null,"errorMessage":"unknown %s %q","messagePattern":"unknown (.+?) %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/go/internal/modload/init.go","lineNumber":2316,"sourceCode":"\t\t}\n\t\tif gover.Compare(v[len(\"go\"):], gover.Local()) > 0 {\n\t\t\treturn fmt.Errorf(\"default=%s too new (toolchain is go%s)\", v, gover.Local())\n\t\t}\n\t\treturn nil\n\t}\n\tif godebugs.Lookup(k) != nil {\n\t\treturn nil\n\t}\n\tfor _, info := range godebugs.Removed {\n\t\tif info.Name == k {\n\t\t\tif info.Old(v) {\n\t\t\t\treturn fmt.Errorf(\"removed GODEBUG %q set to old value %q (https://go.dev/doc/godebug#go-1%v)\", k, v, info.Removed)\n\t\t\t}\n\t\t\t// Using a removed GODEBUG setting with a non-old value is ok (see go.dev/issue/76163).\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn fmt.Errorf(\"unknown %s %q\", verb, k)\n}\n","sourceCodeStart":2298,"sourceCodeEnd":2318,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/go/internal/modload/init.go#L2298-L2318","documentation":"Thrown by CheckGodebug as the fallthrough error when the key passes space/comma validation, is not 'default', is not found in the known GODEBUG registry (godebugs.Lookup returns nil), and is not in the removed list (godebugs.Removed). The verb parameter is 'godebug' and %q is the unknown key. This means the setting name does not correspond to any recognized GODEBUG setting in this Go version.","triggerScenarios":"A go.mod or go.work contains 'godebug typo=1' or references a GODEBUG name that does not exist in the current toolchain's registry. Also occurs if the setting exists only in a newer Go version than the installed toolchain.","commonSituations":"Typing a GODEBUG setting name incorrectly. Using a setting from a newer Go version on an older toolchain. Keeping stale godebug directives after the setting was renamed or never existed.","solutions":["Check the exact GODEBUG setting name against the official list at https://go.dev/doc/godebug.","Correct or remove the misspelled/unknown 'godebug' line in go.mod or go.work.","If the setting should exist, upgrade your Go toolchain to a version that supports it."],"exampleFix":"// before\ngodebug paniconfatl=1  // typo\n\n// after\ngodebug paniconfatal=1","handlingStrategy":"validation","validationCode":"// Validate a godebug key is known (not unknown) before writing.\n// (Requires access to the godebugs registry.)\nfunc validateKnownGodebug(k string) error {\n    if k == \"default\" {\n        return nil\n    }\n    if godebugs.Lookup(k) != nil {\n        return nil\n    }\n    for _, info := range godebugs.Removed {\n        if info.Name == k {\n            return nil // removed but recognized\n        }\n    }\n    return fmt.Errorf(\"unknown godebug %q\", k)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify GODEBUG setting names against https://go.dev/doc/godebug before adding them.","Double-check spelling — common typos like 'paniconfatl' instead of 'paniconfatal' cause this error.","If a setting exists only in a newer Go version, upgrade your toolchain before referencing it."],"tags":["godebug","go-mod","go-work","validation","unknown-key"],"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}