{"id":"1f423f11ad674e44","repo":"jackc/pgx","slug":"cannot-scan-v-to-netip-addr","errorCode":null,"errorMessage":"cannot scan %v to netip.Addr","messagePattern":"cannot scan (.+?) to netip\\.Addr","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/builtin_wrappers.go","lineNumber":593,"sourceCode":"func (w *netipPrefixWrapper) ScanNetipPrefix(v netip.Prefix) error {\n\t*w = netipPrefixWrapper(v)\n\treturn nil\n}\n\nfunc (w netipPrefixWrapper) NetipPrefixValue() (netip.Prefix, error) {\n\treturn netip.Prefix(w), nil\n}\n\ntype netipAddrWrapper netip.Addr\n\nfunc (w *netipAddrWrapper) ScanNetipPrefix(v netip.Prefix) error {\n\tif !v.IsValid() {\n\t\t*w = netipAddrWrapper(netip.Addr{})\n\t\treturn nil\n\t}\n\n\tif v.Addr().BitLen() != v.Bits() {\n\t\treturn fmt.Errorf(\"cannot scan %v to netip.Addr\", v)\n\t}\n\n\t*w = netipAddrWrapper(v.Addr())\n\n\treturn nil\n}\n\nfunc (w netipAddrWrapper) NetipPrefixValue() (netip.Prefix, error) {\n\taddr := (netip.Addr)(w)\n\tif !addr.IsValid() {\n\t\treturn netip.Prefix{}, nil\n\t}\n\n\treturn netip.PrefixFrom(addr, addr.BitLen()), nil\n}\n\ntype mapStringToPointerStringWrapper map[string]*string\n","sourceCodeStart":575,"sourceCodeEnd":611,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/builtin_wrappers.go#L575-L611","documentation":"Error \"cannot scan %v to netip.Addr\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/builtin_wrappers.go:593 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"ec1a0befd22592cffffdeeb0a50311b506372f4c","analyzedAt":"2026-08-04T22:52:11.263Z","schemaVersion":2}