go-delve/delve · error

wrong number of arguments: source <filename>

Error message

wrong number of arguments: source <filename>

What it means

Error "wrong number of arguments: source <filename>" thrown in go-delve/delve.

Source

Thrown at pkg/terminal/command.go:2592

		loc := locs[0]
		if showContext {
			fmt.Fprintf(t.stdout, "Showing %s:%d (PC: %#x)\n", loc.File, loc.Line, loc.PC)
		}
		return loc.File, loc.Line, false, nil
	}
}

func listCommand(t *Term, ctx callContext, args string) error {
	file, lineno, showarrow, err := getLocation(t, ctx, args, true)
	if err != nil {
		return err
	}
	return printfile(t, file, lineno, showarrow)
}

func (c *Commands) sourceCommand(t *Term, ctx callContext, args string) error {
	if len(args) == 0 {
		return errors.New("wrong number of arguments: source <filename>")
	}

	if args == "-" {
		return t.starlarkEnv.REPL()
	}

	if runtime.GOOS != "windows" && strings.HasPrefix(args, "~") {
		home, err := os.UserHomeDir()
		if err == nil {
			if args == "~" {
				args = home
			} else if strings.HasPrefix(args, "~/") {
				args = filepath.Join(home, args[2:])
			}
		}
	}

	if filepath.Ext(args) == ".star" {

View on GitHub (pinned to a23773e6c3)

When it happens

Trigger: Thrown at pkg/terminal/command.go:2592 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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