{"record":{"id":"ff71a595c2a6b5d5","repo":"JanDeDobbeleer/oh-my-posh","slug":"key-value-delimiter-not-found","errorCode":null,"errorMessage":"key-value delimiter not found: ","messagePattern":"key-value delimiter not found: ","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/ini/ini.go","lineNumber":63,"sourceCode":"\t\tline = strings.TrimSpace(line)\n\n\t\tif line == \"\" || line[0] == '#' || line[0] == ';' {\n\t\t\tcontinue\n\t\t}\n\n\t\tif line[0] == '[' {\n\t\t\tname, _, found := strings.CutLast(line, \"]\")\n\t\t\tif !found {\n\t\t\t\treturn nil, errors.New(\"unclosed section: \" + line)\n\t\t\t}\n\n\t\t\tcurrent = file.section(strings.TrimSpace(name[1:]))\n\t\t\tcontinue\n\t\t}\n\n\t\tdelim := strings.IndexAny(line, \"=:\")\n\t\tif delim < 0 {\n\t\t\treturn nil, errors.New(\"key-value delimiter not found: \" + line)\n\t\t}\n\n\t\tname := strings.TrimSpace(line[:delim])\n\t\tvalue := parseValue(line[delim+1:], verbatim)\n\n\t\tif _, ok := current.keys[name]; ok {\n\t\t\tcontinue\n\t\t}\n\n\t\tkey := &Key{name: name, value: value}\n\t\tcurrent.keys[name] = key\n\t\tcurrent.order = append(current.order, key)\n\t}\n\n\treturn file, nil\n}\n\nfunc parseValue(value string, verbatim bool) string {","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/ini/ini.go#L45-L81","documentation":"Every non-blank, non-section, non-comment line in an INI file must contain a key-value delimiter '=' or ':'. If IndexAny finds neither, the line cannot be parsed as a key-value pair and the error echoes the line. This keeps the parser strict rather than silently skipping garbage.","triggerScenarios":"parse() (via Load or LoadVerbatim) reads a line that isn't a section header or comment but contains no '=' or ':' - e.g. 'enable_icons' instead of 'enable_icons = true'.","commonSituations":"Missing '=' after a key when hand-editing a theme; pasting JSON/YAML-style keys into an INI/TOML config; a wrapped line from a bad copy-paste splitting 'key = value' across lines.","solutions":["Fix the reported line so the key is followed by '=' or ':' and a value","Join accidentally wrapped lines back into a single 'key = value' line","Convert the value syntax if the file was authored in another format (JSON/YAML) and rename it accordingly"],"exampleFix":"// before (file content)\nenable_icons\n// after (file content)\nenable_icons = true","handlingStrategy":"validation","validationCode":"for i, line := range lines {\n    l := strings.TrimSpace(line)\n    if l == \"\" || strings.HasPrefix(l, \"[\") || strings.HasPrefix(l, \"#\") {\n        continue\n    }\n    if !strings.ContainsAny(l, \"=:\") {\n        return fmt.Errorf(\"line %d: missing key-value delimiter\", i+1)\n    }\n}","typeGuard":"func isKeyValueLine(line string) bool {\n    l := strings.TrimSpace(line)\n    return l != \"\" && !strings.HasPrefix(l, \"[\") && !strings.HasPrefix(l, \"#\") && strings.ContainsAny(l, \"=:\")\n}","tryCatchPattern":"file, err := ini.Load(path)\nif err != nil {\n    if strings.Contains(err.Error(), \"delimiter not found\") {\n        return fmt.Errorf(\"config %s has a malformed line: %w\", path, err)\n    }\n    return err\n}","preventionTips":["Never wrap 'key = value' across multiple lines","Run a schema/lint check on configs in CI","Convert configs from JSON/YAML instead of pasting lines into INI"],"tags":["ini","parsing","config","syntax-error"],"backgroundTag":"malformed-ini-syntax","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}