go-delve/delve · info

%s:%d: %v

Error message

%s:%d: %v

What it means

The fallback branch of decorateError: when the starlark call frame position has no column information, the error is prefixed as `file:line: err`. It exists so all builtin errors are located, even when position metadata lacks a column.

Source

Thrown at pkg/terminal/starbind/starlark.go:391

	if ctx, ok := thread.Local(dlvContextName).(context.Context); ok {
		select {
		case <-ctx.Done():
			return ctx.Err()
		default:
		}
	}
	return nil
}

func decorateError(thread *starlark.Thread, err error) error {
	if err == nil {
		return nil
	}
	pos := thread.CallFrame(1).Pos
	if pos.Col > 0 {
		return fmt.Errorf("%s:%d:%d: %v", pos.Filename(), pos.Line, pos.Col, err)
	}
	return fmt.Errorf("%s:%d: %v", pos.Filename(), pos.Line, err)
}

type EchoWriter interface {
	io.Writer
	Echo(string)
	Flush()
}

// execFileOptions is a wrapper around starlark.ExecFileOptions.
// If no options are provided, it uses default options.
func execFileOptions(opts *syntax.FileOptions, thread *starlark.Thread, path string, source any, env starlark.StringDict) (starlark.StringDict, error) {
	if opts == nil {
		opts = defaultSyntaxFileOpts
	}
	return starlark.ExecFileOptions(opts, thread, path, source, env)
}

// evalOptions is a wrapper around starlark.EvalOptions.

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Locate the indicated line in the script and check the builtin call there.
  2. Fix the underlying error message after the line number.
  3. If column info is consistently missing and hampers debugging, report it upstream with the script.
Defensive patterns

Strategy: try-catch

Try / catch

err := env.Execute(...)
if err != nil {
    // message shape: "<file>:<line>: <cause>"
    parts := strings.SplitN(err.Error(), ": ", 3)
    log.Printf("script error at %s line %s: %s", parts[0], parts[1], parts[2])
}

Prevention

When it happens

Trigger: Builtin errors raised from contexts where thread.CallFrame(1).Pos.Col == 0, e.g. errors produced during execution of code loaded without column info or from predeclared helpers.

Common situations: Scripts run via Execute where errors surface with only line numbers; users must inspect the whole line rather than an exact column.

Related errors


AI-assisted analysis of go-delve/delve@a23773e6c3 (2026-08-31). Data as JSON: /api/errors/aa9f050ebce1bdb2. Report an issue: GitHub.