go-delve/delve · error

breakpoint name can not be a number

Error message

breakpoint name can not be a number

What it means

ValidBreakpointName validates user-chosen breakpoint names: the name must not be parseable as an integer and must consist only of letters/digits. Purely numeric names collide with Delve's auto-assigned numeric breakpoint IDs, so they are rejected with this error.

Source

Thrown at service/api/types.go:156

	TotalHitCount uint64 `json:"totalHitCount"`
	// Disabled flag, signifying the state of the breakpoint
	Disabled bool `json:"disabled"`

	UserData any `json:"-"`

	// RootFuncName is the Root function from where tracing needs to be done
	RootFuncName string
	// TraceFollowCalls indicates the Depth of tracing
	TraceFollowCalls int
}

// ValidBreakpointName returns an error if
// the name to be chosen for a breakpoint is invalid.
// The name can not be just a number, and must contain a series
// of letters or numbers.
func ValidBreakpointName(name string) error {
	if _, err := strconv.Atoi(name); err == nil {
		return errors.New("breakpoint name can not be a number")
	}

	for _, ch := range name {
		if !(unicode.IsLetter(ch) || unicode.IsDigit(ch)) {
			return fmt.Errorf("invalid character in breakpoint name '%c'", ch)
		}
	}

	return nil
}

// WatchType is the watchpoint type
type WatchType uint8

const (
	WatchRead WatchType = 1 << iota
	WatchWrite
)

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Prefix numeric names with a letter, e.g. "bp42" instead of "42"
  2. Validate with unicode.IsLetter/IsDigit before submitting
  3. Map user-facing numeric labels to an internal alphabetic scheme

Example fix

// before
api.ValidBreakpointName("42")
// after
api.ValidBreakpointName("bp42")
Defensive patterns

Strategy: validation

Validate before calling

func validBPName(name string) bool {
	if _, err := strconv.Atoi(name); err == nil { return false }
	for _, ch := range name {
		if !unicode.IsLetter(ch) && !unicode.IsDigit(ch) { return false }
	}
	return len(name) > 0
}

Prevention

When it happens

Trigger: Calling ValidBreakpointName (directly or via breakpoint creation APIs that accept a name) with values like "42", "007", or "0".

Common situations: IDEs that let users name breakpoints and get a name from a numeric input field; scripts generating sequential numeric names for breakpoints; localization of names into digit-only forms.

Related errors


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