{"record":{"id":"935922e43c279ada","repo":"go-delve/delve","slug":"package-s-has-no-function-s-935922","errorCode":null,"errorMessage":"package %s has no function %s","messagePattern":"package (.+?) has no function (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/variables.go","lineNumber":1170,"sourceCode":"\t\t\t\treturn &v.Children[i], nil\n\t\t\t}\n\t\t}\n\t\treturn nil, fmt.Errorf(\"%s has no member %s\", vname, memberName)\n\t}\n\tclosure := false\n\tswitch v.Kind {\n\tcase reflect.Chan:\n\t\tv = v.clone()\n\t\tv.RealType = godwarf.ResolveTypedef(&(v.RealType.(*godwarf.ChanType).TypedefType))\n\tcase reflect.Func:\n\t\tfn := v.bi.PCToFunc(v.Base)\n\t\tv.loadFunctionPtr(0, LoadConfig{MaxVariableRecurse: -1})\n\t\tif v.Unreadable != nil {\n\t\t\tcst := fn.extra(v.bi).closureStructType\n\t\t\tif cst == nil || cst.ByteSize == 0 {\n\t\t\t\t// Not a closure, normal function\n\t\t\t\tif _, ok := v.bi.PackageMap[vname]; ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"package %s has no function %s\", vname, memberName)\n\t\t\t\t}\n\t\t\t\treturn nil, fmt.Errorf(\"%s has no member %s\", vname, memberName)\n\t\t\t}\n\t\t\treturn nil, v.Unreadable\n\t\t}\n\t\tif v.closureAddr != 0 {\n\t\t\tfn = v.bi.PCToFunc(v.Base)\n\t\t\tif fn != nil {\n\t\t\t\tcst := fn.extra(v.bi).closureStructType\n\t\t\t\tv = v.newVariable(v.Name, v.closureAddr, cst, v.mem)\n\t\t\t\tclosure = true\n\t\t\t}\n\t\t}\n\t}\n\n\tstructVar := v.maybeDereference()\n\tstructVar.Name = v.Name\n\tif structVar.Unreadable != nil {","sourceCodeStart":1152,"sourceCodeEnd":1188,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/variables.go#L1152-L1188","documentation":"When the expression looks like package.Function and the loaded function pointer variable is a plain function (not a closure), Delve checks whether vname is a known package in bi.PackageMap. If it is, this error reports that the package exists but contains no function of that name — a package/function name mismatch.","triggerScenarios":"Evaluating 'pkgname.FuncName' where pkgname is a valid Go package in the binary but no exported symbol FuncName exists in it (misspelling, unexported function, or function inlined/optimized away).","commonSituations":"Case mistakes (pkg.funcname for unexported funcs), functions removed by the linker or inlined so no symbol exists, referring to a different package path than imported.","solutions":["Verify the function exists and is exported in that package (go doc pkgname).","Use the full import path if the package name is ambiguous (e.g. math/rand vs crypto/rand).","Check the functions command in the terminal to search available function symbols.","Disable inlining in the build (-gcflags=all='-N -l') so symbols are not optimized away."],"exampleFix":"// before\ndlv> eval mypkg.helper\nCommand failed: package mypkg has no function helper\n\n// after\ndlv> functions mypkg.helper   // confirm symbol\ndlv> eval mypkg.Helper        // correct name/case","handlingStrategy":"validation","validationCode":"// Resolve the function symbol before evaluating pkg.Func\nfuncs, err := client.ListFunctions(pkgName)\nif err != nil { return err }\nfound := false\nfor _, f := range funcs { if strings.Contains(f, \".\"+funcName) { found = true; break } }\nif !found { return fmt.Errorf(\"symbol %s.%s not found\", pkgName, funcName) }","typeGuard":null,"tryCatchPattern":"v, err := client.EvalVariable(scope, pkg+\".\"+fn, cfg)\nif err != nil && strings.Contains(err.Error(), \"has no function\") {\n    // fall back to ListFunctions search or breakpoint by function name instead\n}","preventionTips":["Verify exported names with `go doc pkg` before evaluating","Use full import paths for ambiguous package names","Build with -gcflags=all='-N -l' to preserve symbols"],"tags":["go","debugger","evaluation","symbols"],"backgroundTag":"symbol-not-found","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}