jdx/mise · error
unexpected interpreted Go string delimiter
Error message
unexpected interpreted Go string delimiter
What it means
When parsing a Go interpreted (double-quoted) string literal for task arguments, mise's unescape_go_string walks the characters after stripping the delimiters. A raw '"' inside the content means the string was not actually a single well-formed literal (embedded delimiter), so parsing bails. This guards the workspace Go task argument parser from treating malformed literals as valid strings.
Solutions
- Escape the inner double quote as \" inside the Go interpreted string literal.
- Split the value into multiple concatenated literals: "a" + "b".
- Use a Go raw string literal with backticks (`a"b`) if no escapes are needed.
Example fix
// before args = ["\"hello\" world\""] // literal: "hello" world" // after args = ["\"hello world\""] // literal: "hello world"
Defensive patterns
Strategy: validation
Validate before calling
function validateGoInterpretedLiteral(raw) {
const inner = raw.slice(1, -1); // strip surrounding quotes
if (/(?<!\\)"/.test(inner)) throw new Error('unescaped " inside Go string literal');
return true;
} Prevention
- Always escape inner double quotes as \" in Go interpreted strings.
- Prefer raw strings (backticks) when the literal contains quotes and needs no escapes.
When it happens
Trigger: Calling parse_argument with a value like `"a"b"` where an unescaped double quote appears inside a Go interpreted string literal.
Common situations: Hand-written mise.toml task args quoting Go string literals incorrectly; copy-pasted Go snippets where inner quotes were not escaped with \"; tooling that generated the literal without escaping.
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
- incomplete Go string escape
- unsupported Go string escape \
- additional_artifacts must be an array in lockfile
- directive requires exactly one argument
- directive requires one argument
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/49b9646b3af12c90.
Report an issue: GitHub.
Appendix: 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 533346cc37)