{"record":{"id":"f3c01aec08be262b","repo":"go-delve/delve","slug":"s-has-no-member-s","errorCode":null,"errorMessage":"%s has no member %s","messagePattern":"(.+?) has no member (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/eval.go","lineNumber":3023,"sourceCode":"\treturn r, nil\n}\n\n// findStructMemberOrMethod finds struct member or method name in the type of variable v\nfunc (v *Variable) findStructMemberOrMethod(name string, includeStructMember bool) (*Variable, error) {\n\tif v.Unreadable != nil {\n\t\treturn v.clone(), nil\n\t}\n\tvname := v.Name\n\tif v.Name == \"\" {\n\t\tvname = v.DwarfType.String()\n\t}\n\tif v.loaded && (v.Flags&VariableFakeAddress) != 0 {\n\t\tfor i := range v.Children {\n\t\t\tif v.Children[i].Name == name {\n\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, name)\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.Interface:\n\t\tv.loadInterface(0, false, LoadConfig{})\n\t\tif len(v.Children) > 0 {\n\t\t\tv = &v.Children[0]\n\t\t}\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","sourceCodeStart":3005,"sourceCodeEnd":3041,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/eval.go#L3005-L3041","documentation":"Returned by the member-access logic (find member / struct member selection) in eval.go. When the variable is a loaded fake-address value (e.g. the result of a literal or a loaded composite whose members are pre-populated Children), Delve searches v.Children for a field with the requested name. If none matches, it reports '<varname> has no member <name>'.","triggerScenarios":"Evaluating expr.fieldName where expr is a fake-address/loaded variable (VariableFakeAddress flag set) and no child has that Name — e.g. typo'd field names on struct literals constructed in expressions, or accessing fields on values that don't have them.","commonSituations":"Typos in field names in watch expressions; accessing a field on the wrong struct type; using a field that exists only in a different struct version; trying to access members of non-struct values built as literals in conditions.","solutions":["Print the value (print expr) to list its actual fields and verify the exact member name","Fix the typo / use the correct field name per the current source version","Confirm the expression type is the struct you intend (whatis expr)","If the field exists in source but not at runtime, rebuild the binary so DWARF matches the sources"],"exampleFix":"// before\nprint(myPoint.Xcoord)      // no such member\n// after\nprint(myPoint.X)           // matches actual field name","handlingStrategy":"validation","validationCode":"// list actual members first:\nprint(expr)   // shows available fields\nwhatis expr   // confirms the struct type","typeGuard":"// only access .field after confirming it exists in the printed member list","tryCatchPattern":null,"preventionTips":["Autocomplete/inspect before typing member names","Keep binary and sources in sync (rebuild after field renames)","Verify you're accessing the intended struct type"],"tags":["go","debugger","member-access","eval"],"backgroundTag":"no-such-member","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}