go-delve/delve · error

package %s has no function %s

Error message

package %s has no function %s

What it means

Raised when evaluating a member on what looks like a function/package symbol. If the target is a normal (non-closure) function and its package vname is known to the binary info (bi.PackageMap), but no function 'name' exists in that package, Delve reports 'package <pkg> has no function <name>'. This is the package-qualified variant of the no-member error for function values.

Source

Thrown at pkg/proc/eval.go:3043

	closure := false
	switch v.Kind {
	case reflect.Chan:
		v = v.clone()
		v.RealType = godwarf.ResolveTypedef(&(v.RealType.(*godwarf.ChanType).TypedefType))
	case reflect.Interface:
		v.loadInterface(0, false, LoadConfig{})
		if len(v.Children) > 0 {
			v = &v.Children[0]
		}
	case reflect.Func:
		fn := v.bi.PCToFunc(v.Base)
		v.loadFunctionPtr(0, LoadConfig{MaxVariableRecurse: -1})
		if v.Unreadable != nil {
			cst := fn.extra(v.bi).closureStructType
			if cst == nil || cst.ByteSize == 0 {
				// Not a closure, normal function
				if _, ok := v.bi.PackageMap[vname]; ok {
					return nil, fmt.Errorf("package %s has no function %s", vname, name)
				}
				return nil, fmt.Errorf("%s has no member %s", vname, name)
			}
			return nil, v.Unreadable
		}
		if v.closureAddr != 0 {
			fn = v.bi.PCToFunc(v.Base)
			if fn != nil {
				cst := fn.extra(v.bi).closureStructType
				v = v.newVariable(v.Name, v.closureAddr, cst, v.mem)
				closure = true
			}
		}
	}

	queue := []*Variable{v}
	seen := map[string]struct{}{}
	first := true

View on GitHub (pinned to a23773e6c3)

Solutions

  1. Check spelling and case of the function name (Go is case-sensitive)
  2. Use the correct package path as known to the binary (print the variable first or use 'whatis')
  3. Verify the function still exists in the version of the package compiled into the binary
  4. If the function was inlined, breakpoints/lookup may need the non-inlined name or a line-based breakpoint

Example fix

// before
print(fmt.PrintLn("x"))    // no such function
// after
print(fmt.Println("x"))    // correct name
Defensive patterns

Strategy: validation

Validate before calling

// verify the function exists in the package:
break fmt.Println   // or: print fmt.Println
// check exact spelling and case first

Prevention

When it happens

Trigger: Evaluating pkg.Func or calling/inspecting a function member where v.loadFunctionPtr determined the value is a plain function, vname is a known package in PackageMap, and 'name' is not any function in that package (typo or wrong package).

Common situations: Typos like fmt.PrintLn (capital L); referencing a function that was inlined away or removed in the built version; wrong package name in qualified expressions (e.g. strings.Title removed in newer Go).

Related errors


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