{"id":"3906c2db5566b183","repo":"jackc/pgx","slug":"invalid-net-ip","errorCode":null,"errorMessage":"invalid net.IP","messagePattern":"invalid net\\.IP","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/builtin_wrappers.go","lineNumber":567,"sourceCode":"\t\treturn nil\n\t}\n\n\tif v.Addr().BitLen() != v.Bits() {\n\t\treturn fmt.Errorf(\"cannot scan %v to *net.IP\", v)\n\t}\n\n\t*w = netIPWrapper(v.Addr().AsSlice())\n\treturn nil\n}\n\nfunc (w netIPWrapper) NetipPrefixValue() (netip.Prefix, error) {\n\tif w == nil {\n\t\treturn netip.Prefix{}, nil\n\t}\n\n\taddr, ok := netip.AddrFromSlice([]byte(w))\n\tif !ok {\n\t\treturn netip.Prefix{}, errors.New(\"invalid net.IP\")\n\t}\n\n\treturn netip.PrefixFrom(addr, addr.BitLen()), nil\n}\n\ntype netipPrefixWrapper netip.Prefix\n\nfunc (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","sourceCodeStart":549,"sourceCodeEnd":585,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/builtin_wrappers.go#L549-L585","documentation":"Error \"invalid net.IP\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/builtin_wrappers.go:567 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}