Add inet and cidr to pgtype
This commit is contained in:
@@ -3,6 +3,7 @@ package pgtype_test
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"reflect"
|
||||
"testing"
|
||||
@@ -44,6 +45,15 @@ func mustClose(t testing.TB, conn interface {
|
||||
}
|
||||
}
|
||||
|
||||
func mustParseCIDR(t testing.TB, s string) *net.IPNet {
|
||||
_, ipnet, err := net.ParseCIDR(s)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
return ipnet
|
||||
}
|
||||
|
||||
type forceTextEncoder struct {
|
||||
e pgtype.TextEncoder
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user