{"record":{"id":"1d3fa053aa79b27c","repo":"matryer/xbar","slug":"emojize","errorCode":null,"errorMessage":"emojize","messagePattern":"emojize","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/plugins/item_params.go","lineNumber":249,"sourceCode":"\t\t}\n\t\tp.Length = val\n\tcase \"trim\":\n\t\tvar err error\n\t\tp.Trim, err = parseBool(value)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, key)\n\t\t}\n\tcase \"alternate\":\n\t\tvar err error\n\t\tp.Alternate, err = parseBool(value)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, key)\n\t\t}\n\tcase \"emojize\":\n\t\tvar err error\n\t\tp.Emojize, err = parseBool(value)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, key)\n\t\t}\n\tcase \"ansi\":\n\t\tvar err error\n\t\tp.ANSI, err = parseBool(value)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, key)\n\t\t}\n\tdefault:\n\t\tif strings.HasPrefix(key, \"param\") {\n\t\t\tparamIndex, err := strconv.Atoi(key[5:])\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Errorf(\"bad parameter: %s (should be paramN)\", key)\n\t\t\t}\n\t\t\tfor len(p.ShellParams) < paramIndex {\n\t\t\t\t// ensure the slice is big enough\n\t\t\t\tp.ShellParams = append(p.ShellParams, \"\")\n\t\t\t}\n\t\t\tp.ShellParams[paramIndex-1] = value","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/matryer/xbar/blob/d624239058997c80118eaebe2e7f8331b3c765e0/pkg/plugins/item_params.go#L231-L267","documentation":"This error occurs when the \"emojize\" key in a plugin item's parameter string cannot be parsed as a boolean. setValueByKey calls parseBool for the emojize value and wraps the failure with the key \"emojize\". It means the emojize= value (controlling :emoji: code conversion) is not a valid boolean literal.","triggerScenarios":"Parsing a param string containing 'emojize=enable', 'emojize=1 ', 'emojize=' (empty), or any value strconv.ParseBool rejects.","commonSituations":"Developers disabling emoji conversion write verbs like enable/disable or no; hand-edited metadata with whitespace, or scripts interpolating unset variables into the value.","solutions":["Use emojize=true or emojize=false (1/0, t/f also accepted).","Remove stray whitespace or punctuation from the value.","Ensure the generating script emits literal true/false (e.g. ${{VAR:+true}} style guards rather than raw variable text).","Remove the key entirely to accept the default (emojize is true by default)."],"exampleFix":"// before\nparams := \"emojize=disable\"\n// after\nparams := \"emojize=false\"","handlingStrategy":"validation","validationCode":"func validBoolParam(params string, key string) bool {\n    for _, kv := range strings.Split(params, \",\") {\n        parts := strings.SplitN(kv, \"=\", 2)\n        if len(parts) == 2 && parts[0] == key {\n            _, err := strconv.ParseBool(parts[1])\n            return err == nil\n        }\n    }\n    return true\n}\n// validBoolParam(\"emojize=enable\", \"emojize\") == false","typeGuard":"func isGoBool(s string) bool {\n    _, err := strconv.ParseBool(s)\n    return err == nil\n}","tryCatchPattern":"if err := item.ParseParams(raw); err != nil {\n    if strings.Contains(err.Error(), \"emojize\") {\n        log.Printf(\"invalid emojize value in %q: %v\", raw, err)\n        return // skip or fall back to defaults\n    }\n}","preventionTips":["Use emojize=true/false; emojize defaults to true so omit it to keep emoji conversion on.","Never write enable/disable/no as the value.","Validate generated metadata lines before they reach the menu bar.","Avoid key= with an empty value when disabling a feature."],"tags":["go","config-parsing","boolean-parse"],"backgroundTag":"invalid-boolean-value","analyzedSha":"d624239058997c80118eaebe2e7f8331b3c765e0","analyzedAt":"2026-09-02T22:38:22.007Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}