{"record":{"id":"49b9646b3af12c90","repo":"jdx/mise","slug":"unexpected-interpreted-go-string-delimiter","errorCode":null,"errorMessage":"unexpected interpreted Go string delimiter","messagePattern":"unexpected interpreted Go string delimiter","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/workspace/go.rs","lineNumber":209,"sourceCode":"            bail!(\"unterminated raw Go string\");\n        };\n        if value.contains('`') {\n            bail!(\"unexpected raw Go string delimiter\");\n        }\n        return Ok(value.to_string());\n    }\n    if value.split_whitespace().count() != 1 {\n        bail!(\"directive requires exactly one argument\");\n    }\n    Ok(value.to_string())\n}\n\nfn unescape_go_string(value: &str) -> Result<String> {\n    let mut characters = value.chars();\n    let mut unescaped = String::new();\n    while let Some(character) = characters.next() {\n        if character == '\"' {\n            bail!(\"unexpected interpreted Go string delimiter\");\n        }\n        if character != '\\\\' {\n            unescaped.push(character);\n            continue;\n        }\n        let escape = characters\n            .next()\n            .ok_or_else(|| eyre::eyre!(\"unterminated Go string escape\"))?;\n        let escaped = match escape {\n            'a' => '\\u{0007}',\n            'b' => '\\u{0008}',\n            'f' => '\\u{000c}',\n            'n' => '\\n',\n            'r' => '\\r',\n            't' => '\\t',\n            'v' => '\\u{000b}',\n            '\\\\' => '\\\\',\n            '\\'' => '\\'',","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/task/workspace/go.rs#L191-L227","documentation":"`unescape_go_string` processes the inner characters of an interpreted Go string. Go interpreted strings may not contain a raw `\"` character (it must be escaped as `\\\"`), so encountering an unescaped quote inside the value throws this error.","triggerScenarios":"A directive argument like `module \"ex\"ample\"` where the inner quotes are not backslash-escaped; `parse_argument` strips the outer pair and `unescape_go_string` hits the bare `\"` inside.","commonSituations":"Quoting a value that itself contains quotes; hand-escaping mistakes; copy-pasting values from JSON or other formats without adapting quoting.","solutions":["Escape the interior quotes as \\\" inside the interpreted string","Remove the interior quotes from the value","Use a raw backtick string instead if the value contains both quotes and backslashes"],"exampleFix":"// before\nmodule \"ex\"ample\"\n// after\nmodule \"ex\\\"ample\"\n","handlingStrategy":"validation","validationCode":"fn validate_inner_quotes(inner: &str) -> Result<()> {\n    anyhow::ensure!(!inner.contains('\"'), \"escape interior quotes as \\\\\\\" inside interpreted strings\");\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Escape interior double quotes as \\\"","Count quotes: an interpreted string argument must contain an even, properly paired set","Use raw backtick strings for quote-heavy values"],"tags":["parsing","go","strings"],"backgroundTag":"invalid-argument-format","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}