2
0

Add inet and cidr to pgtype

This commit is contained in:
Jack Christensen
2017-03-04 17:33:41 -06:00
parent 2010bea555
commit 4cdea13f0f
11 changed files with 916 additions and 43 deletions
+10
View File
@@ -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
}