{"record":{"id":"00f17c9463c81523","repo":"go-delve/delve","slug":"can-not-watch-variable-of-type-s","errorCode":null,"errorMessage":"can not watch variable of type %s","messagePattern":"can not watch variable of type (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/breakpoints.go","lineNumber":740,"sourceCode":"\t\treturn nil, errors.New(\"at least one of read and write must be set for watchpoint\")\n\t}\n\n\tn, err := parser.ParseExpr(expr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\txv, err := scope.evalAST(n)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif xv.Addr == 0 || xv.Flags&VariableFakeAddress != 0 || xv.DwarfType == nil {\n\t\treturn nil, fmt.Errorf(\"can not watch %q\", expr)\n\t}\n\tif xv.Unreadable != nil {\n\t\treturn nil, fmt.Errorf(\"expression %q is unreadable: %v\", expr, xv.Unreadable)\n\t}\n\tif xv.Kind == reflect.UnsafePointer || xv.Kind == reflect.Invalid {\n\t\treturn nil, fmt.Errorf(\"can not watch variable of type %s\", xv.Kind.String())\n\t}\n\n\t// Special handling for interface types\n\tif xv.Kind == reflect.Interface {\n\t\t// For interfaces, we want to watch the data they point to\n\t\t// Read the interface to get the data pointer\n\t\t_, data, _ := xv.readInterface()\n\t\tif xv.Unreadable != nil {\n\t\t\treturn nil, fmt.Errorf(\"error reading interface %q: %v\", expr, xv.Unreadable)\n\t\t}\n\t\tif data == nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid interface %q\", expr)\n\t\t}\n\n\t\t// Use the data field as our watch target\n\t\txv = data\n\t\texpr = expr + \" (interface data)\"\n\t}","sourceCodeStart":722,"sourceCodeEnd":758,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/breakpoints.go#L722-L758","documentation":"Error \"can not watch variable of type %s\" thrown in go-delve/delve.","triggerScenarios":"Thrown at pkg/proc/breakpoints.go:740 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}