{"record":{"id":"16ddce7754e8c2c0","repo":"jdx/mise","slug":"unexpected-raw-go-string-delimiter","errorCode":null,"errorMessage":"unexpected raw Go string delimiter","messagePattern":"unexpected raw Go string delimiter","errorType":"validation","errorClass":"eyre::Report","httpStatus":null,"severity":"error","filePath":"src/task/workspace/go.rs","lineNumber":194,"sourceCode":"    Some(rest.trim())\n}\n\nfn parse_argument(value: &str) -> Result<String> {\n    if value.is_empty() {\n        bail!(\"directive requires one argument\");\n    }\n    if let Some(value) = value.strip_prefix('\"') {\n        let Some(value) = value.strip_suffix('\"') else {\n            bail!(\"unterminated interpreted Go string\");\n        };\n        return unescape_go_string(value);\n    }\n    if let Some(value) = value.strip_prefix('`') {\n        let Some(value) = value.strip_suffix('`') else {\n            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);","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/task/workspace/go.rs#L176-L212","documentation":"After strip_prefix/strip_suffix backticks succeed, parse_argument checks the raw string body for any remaining '`' character; Go raw strings cannot contain a backtick (there is no escape), so an interior delimiter makes the token ambiguous and this error is raised. The outer pair matched, but the content itself contains a stray delimiter.","triggerScenarios":"An entry like a backtick-wrapped `a`b` where the body contains another backtick (the first and last backticks pair up, leaving `a`b` with an interior delimiter); paths copied from markdown/code spans that carried backticks in.","commonSituations":"Copy-pasting paths from documentation where backticks were formatting; attempting to quote a path that legitimately contains a backtick character; nested quoting experiments while handling spaces.","solutions":["Remove the interior backtick from the path or rename the directory so it contains none","If quoting is needed, use an interpreted string \\\"...\\\" — backticks have no escape sequence in raw strings","Double-check pasted entries for markdown formatting characters"],"exampleFix":"# before (go.work) — entry copied from markdown with stray backtick\nuse `api`\n\n# after\nuse ./api","handlingStrategy":"validation","validationCode":"fn raw_string_body_is_clean(token: &str) -> bool {\n    match token.strip_prefix('`').and_then(|b| b.strip_suffix('`')) {\n        Some(body) => !body.contains('`'),\n        None => true,\n    }\n}","typeGuard":"fn is_valid_raw_string(token: &str) -> bool {\n    match token.strip_prefix('`').and_then(|b| b.strip_suffix('`')) {\n        Some(body) => !body.contains('`'),\n        None => false,\n    }\n}","tryCatchPattern":"Err(report) if report.to_string().contains(\"unexpected raw Go string delimiter\") => {\n    // de-markdown the token: drop every backtick and treat it as a plain path\n    let token: String = token.chars().filter(|c| *c != '`').collect();\n    directories.push(PathBuf::from(token));\n}","preventionTips":["Never paste paths from markdown code spans without removing the backticks","Rename directories whose names contain backticks (unsupported by Go raw strings)","Use interpreted strings when the value must contain a backtick"],"tags":["go","go-work","parse","string-literal","syntax"],"backgroundTag":"malformed-string-literal","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}