{"record":{"id":"900f8b8b6ba78bb4","repo":"matryer/xbar","slug":"disabled","errorCode":null,"errorMessage":"disabled","messagePattern":"disabled","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/plugins/item_params.go","lineNumber":183,"sourceCode":"\t\ts = s[end+1:]\n\t}\n}\n\n// defaultParams are the default ItemParams.\nvar defaultParams = ItemParams{\n\tDropdown: true,\n\tTrim:     true,\n\tEmojize:  true,\n\tANSI:     true,\n}\n\nfunc (p *ItemParams) setValueByKey(key, value string) error {\n\tswitch key {\n\tcase \"disabled\":\n\t\tvar err error\n\t\tp.Disabled, err = parseBool(value)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, key)\n\t\t}\n\tcase \"key\":\n\t\tp.Key = value\n\tcase \"href\":\n\t\tp.Href = value\n\tcase \"color\":\n\t\tvar err error\n\t\tp.Color, err = parseColor(value)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, key)\n\t\t}\n\tcase \"font\":\n\t\tp.Font = value\n\tcase \"size\":\n\t\tval, err := parseInt(value)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, key)\n\t\t}","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/matryer/xbar/blob/d624239058997c80118eaebe2e7f8331b3c765e0/pkg/plugins/item_params.go#L165-L201","documentation":"Returned by ItemParams.setValueByKey when the 'disabled' parameter value cannot be parsed as a boolean (parseBool fails). The parse error is wrapped with the key name, producing the message 'disabled: ...'. It surfaces while parsing plugin item parameter strings into an ItemParams struct.","triggerScenarios":"parseParamStr encounters key 'disabled' with a value not parseable by parseBool — e.g. 'disabled=yes', 'disabled=1 '? (whitespace), 'disabled=0x0', or an empty value where the parser expects true/false.","commonSituations":"Hand-edited plugin config files using YAML/JSON-style truthy values (yes/no/on/off) instead of true/false; trailing spaces or quotes around the value; copy-pasted config from another tool.","solutions":["Change the value to a boolean literal: disabled=true or disabled=false.","Trim whitespace and remove surrounding quotes from the parameter value.","Remove the 'disabled' key entirely if it should not be disabled."],"exampleFix":"// before\ndisabled=yes\n// after\ndisabled=false","handlingStrategy":"validation","validationCode":"func validBoolParam(key, value string) error {\n    if key == \"disabled\" {\n        v := strings.TrimSpace(value)\n        if v != \"true\" && v != \"false\" {\n            return fmt.Errorf(\"disabled must be true/false, got %q\", value)\n        }\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"params, err := parseParamStr(raw)\nif err != nil && strings.HasPrefix(err.Error(), \"disabled:\") {\n    log.Printf(\"invalid 'disabled' value in %q, defaulting to false\", raw)\n    params.Disabled = false\n}","preventionTips":["Only use lowercase true/false for boolean item params.","Trim whitespace and quotes from config values before parsing.","Do not copy YAML-style booleans (yes/no/on/off) into these params.","Validate plugin config files with a linter before loading."],"tags":["go","parsing","plugin-params","boolean"],"backgroundTag":"invalid-boolean-parameter","analyzedSha":"d624239058997c80118eaebe2e7f8331b3c765e0","analyzedAt":"2026-09-02T22:38:22.007Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}