jdx/mise · error

unexpected interpreted Go string delimiter

Error message

unexpected interpreted Go string delimiter

What it means

`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.

Source

Thrown at src/task/workspace/go.rs:209

            bail!("unterminated raw Go string");
        };
        if value.contains('`') {
            bail!("unexpected raw Go string delimiter");
        }
        return Ok(value.to_string());
    }
    if value.split_whitespace().count() != 1 {
        bail!("directive requires exactly one argument");
    }
    Ok(value.to_string())
}

fn unescape_go_string(value: &str) -> Result<String> {
    let mut characters = value.chars();
    let mut unescaped = String::new();
    while let Some(character) = characters.next() {
        if character == '"' {
            bail!("unexpected interpreted Go string delimiter");
        }
        if character != '\\' {
            unescaped.push(character);
            continue;
        }
        let escape = characters
            .next()
            .ok_or_else(|| eyre::eyre!("unterminated Go string escape"))?;
        let escaped = match escape {
            'a' => '\u{0007}',
            'b' => '\u{0008}',
            'f' => '\u{000c}',
            'n' => '\n',
            'r' => '\r',
            't' => '\t',
            'v' => '\u{000b}',
            '\\' => '\\',
            '\'' => '\'',

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Escape the interior quotes as \" inside the interpreted string
  2. Remove the interior quotes from the value
  3. Use a raw backtick string instead if the value contains both quotes and backslashes

Example fix

// before
module "ex"ample"
// after
module "ex\"ample"
Defensive patterns

Strategy: validation

Validate before calling

fn validate_inner_quotes(inner: &str) -> Result<()> {
    anyhow::ensure!(!inner.contains('"'), "escape interior quotes as \\\" inside interpreted strings");
    Ok(())
}

Prevention

When it happens

Trigger: 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.

Common situations: Quoting a value that itself contains quotes; hand-escaping mistakes; copy-pasting values from JSON or other formats without adapting quoting.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/49b9646b3af12c90. Report an issue: GitHub.