{"record":{"id":"a6143ba93ac0cf44","repo":"jdx/mise","slug":"unsupported-go-string-escape-escape-a6143b","errorCode":null,"errorMessage":"unsupported Go string escape \\{escape}","messagePattern":"unsupported Go string escape \\\\(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/workspace/go.rs","lineNumber":243,"sourceCode":"            'v' => '\\u{000b}',\n            '\\\\' => '\\\\',\n            '\\'' => '\\'',\n            '\"' => '\"',\n            'x' => escape_character(&mut characters, 2, 16)?,\n            'u' => escape_character(&mut characters, 4, 16)?,\n            'U' => escape_character(&mut characters, 8, 16)?,\n            digit @ '0'..='7' => {\n                let mut digits = digit.to_string();\n                for _ in 0..2 {\n                    digits.push(\n                        characters\n                            .next()\n                            .ok_or_else(|| eyre::eyre!(\"incomplete octal Go string escape\"))?,\n                    );\n                }\n                decoded_character(&digits, 8)?\n            }\n            _ => bail!(\"unsupported Go string escape \\\\{escape}\"),\n        };\n        unescaped.push(escaped);\n    }\n    Ok(unescaped)\n}\n\nfn escape_character(\n    characters: &mut std::str::Chars<'_>,\n    length: usize,\n    radix: u32,\n) -> Result<char> {\n    let digits = characters.take(length).collect::<String>();\n    if digits.chars().count() != length {\n        bail!(\"incomplete Go string escape\");\n    }\n    decoded_character(&digits, radix)\n}\n","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/task/workspace/go.rs#L225-L261","documentation":"unescape_go_string only supports Go's documented escape sequences (\\a \\b \\f \\n \\r \\t \\v \\\\ \\\" octal, hex, and unicode forms). Any other backslash-introduced character falls through to this bail. It surfaces when the task argument contains a backslash escape Go itself would reject.","triggerScenarios":"parse_argument receives a Go interpreted string literal containing an escape like \\q, \\e, \\z, or a stray backslash before an ordinary character.","commonSituations":"Windows-style paths written as \"C:\\Users\\x\" inside a Go-style literal; regex patterns with backslashes pasted into task args; typos such as \\<space>.","solutions":["Use a supported escape: double the backslash (\\\\) for a literal backslash.","Correct the typo to a valid Go escape sequence (e.g. \\n, \\t, \\x41).","Switch to a Go raw string (backticks) to avoid escapes entirely."],"exampleFix":"// before\nargs = [\"C:\\Users\\test\"]\n// after\nargs = [\"C:\\\\Users\\\\test\"]","handlingStrategy":"validation","validationCode":"const VALID = /^[abfnrtv\\\\'\"xuU0-7]$/;\nfunction validateEscapes(inner) {\n  for (let i = 0; i < inner.length; i++) {\n    if (inner[i] === '\\\\' && !VALID.test(inner[i + 1] ?? '')) return false;\n  }\n  return true;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Double every literal backslash in interpreted strings.","Validate Go literals with `go vet` or a quick `printf '%s'` compile check before pasting into config."],"tags":["go","parsing","string-escaping","escape-sequence"],"backgroundTag":"invalid-argument-format","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}