Skip to content

Commit 67ba4e0

Browse files
committed
Fix README, fix Valuer methods
* Fix import paths
1 parent 4f91fe4 commit 67ba4e0

21 files changed

+45
-45
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
## null [![GoDoc](https://godoc.org/github.com/guregu/null?status.svg)](https://godoc.org/github.com/guregu/null) [![Coverage](http://gocover.io/_badge/github.com/guregu/null)](http://gocover.io/github.com/guregu/null)
2-
`import "gopkg.in/guregu/null.v3"`
1+
## null-extended [![GoDoc](https://godoc.org/github.com/nullbio/null?status.svg)](https://godoc.org/github.com/nullbio/null) [![Coverage](http://gocover.io/_badge/github.com/nullbio/null)](http://gocover.io/github.com/nullbio/null)
2+
`import "gopkg.in/nullbio/null.v4"`
33

44
null is a library with reasonable options for dealing with nullable SQL and JSON values
55

@@ -9,11 +9,11 @@ Types in `null` will only be considered null on null input, and will JSON encode
99

1010
Types in `zero` are treated like zero values in Go: blank string input will produce a null `zero.String`, and null Strings will JSON encode to `""`. Zero values of these types will be considered null to SQL. If you need zero and null treated the same, use these.
1111

12-
All types implement `sql.Scanner` and `driver.Valuer`, so you can use this library in place of `sql.NullXXX`. All types also implement: `encoding.TextMarshaler`, `encoding.TextUnmarshaler`, `json.Marshaler`, and `json.Unmarshaler`.
12+
All types implement `sql.Scanner` and `driver.Valuer`, so you can use this library in place of `sql.NullXXX`. All types also implement: `encoding.TextMarshaler`, `encoding.TextUnmarshaler`, `json.Marshaler`, `json.Unmarshaler` and `sql.Scanner`.
1313

1414
### null package
1515

16-
`import "gopkg.in/guregu/null.v3"`
16+
`import "gopkg.in/nullbio/null.v4"`
1717

1818
#### null.String
1919
Nullable string.
@@ -91,7 +91,7 @@ Marshals to JSON null if SQL source data is null. Zero input will not produce a
9191

9292
### zero package
9393

94-
`import "gopkg.in/guregu/null.v3/zero"`
94+
`import "gopkg.in/nullbio/null.v4/zero"`
9595

9696
#### zero.String
9797
Nullable string.

float32.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"strconv"
99

10-
"github.com/pobri19/null-extended/convert"
10+
"gopkg.in/nullbio/null.v4/convert"
1111
)
1212

1313
// NullFloat32 is a replica of sql.NullFloat64 for float32 types.
@@ -142,5 +142,5 @@ func (n NullFloat32) Value() (driver.Value, error) {
142142
if !n.Valid {
143143
return nil, nil
144144
}
145-
return n.Float32, nil
145+
return float64(n.Float32), nil
146146
}

int.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"strconv"
99

10-
"github.com/pobri19/null-extended/convert"
10+
"gopkg.in/nullbio/null.v4/convert"
1111
)
1212

1313
// NullInt is a replica of sql.NullInt64 for int types.
@@ -143,5 +143,5 @@ func (n NullInt) Value() (driver.Value, error) {
143143
if !n.Valid {
144144
return nil, nil
145145
}
146-
return n.Int, nil
146+
return int64(n.Int), nil
147147
}

int16.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"strconv"
99

10-
"github.com/pobri19/null-extended/convert"
10+
"gopkg.in/nullbio/null.v4/convert"
1111
)
1212

1313
// NullInt16 is a replica of sql.NullInt64 for int16 types.
@@ -143,5 +143,5 @@ func (n NullInt16) Value() (driver.Value, error) {
143143
if !n.Valid {
144144
return nil, nil
145145
}
146-
return n.Int16, nil
146+
return int64(n.Int16), nil
147147
}

int32.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"strconv"
99

10-
"github.com/pobri19/null-extended/convert"
10+
"gopkg.in/nullbio/null.v4/convert"
1111
)
1212

1313
// NullInt32 is a replica of sql.NullInt64 for int32 types.
@@ -143,5 +143,5 @@ func (n NullInt32) Value() (driver.Value, error) {
143143
if !n.Valid {
144144
return nil, nil
145145
}
146-
return n.Int32, nil
146+
return int64(n.Int32), nil
147147
}

int8.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"strconv"
99

10-
"github.com/pobri19/null-extended/convert"
10+
"gopkg.in/nullbio/null.v4/convert"
1111
)
1212

1313
// NullInt8 is a replica of sql.NullInt64 for int8 types.
@@ -143,5 +143,5 @@ func (n NullInt8) Value() (driver.Value, error) {
143143
if !n.Valid {
144144
return nil, nil
145145
}
146-
return n.Int8, nil
146+
return int64(n.Int8), nil
147147
}

uint.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"strconv"
99

10-
"github.com/pobri19/null-extended/convert"
10+
"gopkg.in/nullbio/null.v4/convert"
1111
)
1212

1313
// NullUint is a replica of sql.NullInt64 for uint types.
@@ -143,5 +143,5 @@ func (n NullUint) Value() (driver.Value, error) {
143143
if !n.Valid {
144144
return nil, nil
145145
}
146-
return n.Uint, nil
146+
return int64(n.Uint), nil
147147
}

uint16.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"strconv"
99

10-
"github.com/pobri19/null-extended/convert"
10+
"gopkg.in/nullbio/null.v4/convert"
1111
)
1212

1313
// NullUint16 is a replica of sql.NullInt64 for uint16 types.
@@ -143,5 +143,5 @@ func (n NullUint16) Value() (driver.Value, error) {
143143
if !n.Valid {
144144
return nil, nil
145145
}
146-
return n.Uint16, nil
146+
return int64(n.Uint16), nil
147147
}

uint32.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"strconv"
99

10-
"github.com/pobri19/null-extended/convert"
10+
"gopkg.in/nullbio/null.v4/convert"
1111
)
1212

1313
// NullUint32 is a replica of sql.NullInt64 for uint32 types.
@@ -143,5 +143,5 @@ func (n NullUint32) Value() (driver.Value, error) {
143143
if !n.Valid {
144144
return nil, nil
145145
}
146-
return n.Uint32, nil
146+
return int64(n.Uint32), nil
147147
}

uint64.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"strconv"
99

10-
"github.com/pobri19/null-extended/convert"
10+
"gopkg.in/nullbio/null.v4/convert"
1111
)
1212

1313
// NullUint64 is a replica of sql.NullInt64 for uint64 types.
@@ -143,5 +143,5 @@ func (n NullUint64) Value() (driver.Value, error) {
143143
if !n.Valid {
144144
return nil, nil
145145
}
146-
return n.Uint64, nil
146+
return int64(n.Uint64), nil
147147
}

uint8.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"strconv"
99

10-
"github.com/pobri19/null-extended/convert"
10+
"gopkg.in/nullbio/null.v4/convert"
1111
)
1212

1313
// NullUint8 is a replica of sql.NullInt64 for uint8 types.
@@ -143,5 +143,5 @@ func (n NullUint8) Value() (driver.Value, error) {
143143
if !n.Valid {
144144
return nil, nil
145145
}
146-
return n.Uint8, nil
146+
return int64(n.Uint8), nil
147147
}

zero/float32.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"strconv"
99

10-
"github.com/pobri19/null-extended/convert"
10+
"gopkg.in/nullbio/null.v4/convert"
1111
)
1212

1313
type NullFloat32 struct {
@@ -140,5 +140,5 @@ func (n NullFloat32) Value() (driver.Value, error) {
140140
if !n.Valid {
141141
return nil, nil
142142
}
143-
return n.Float32, nil
143+
return float64(n.Float32), nil
144144
}

zero/int.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"strconv"
99

10-
"github.com/pobri19/null-extended/convert"
10+
"gopkg.in/nullbio/null.v4/convert"
1111
)
1212

1313
type NullInt struct {
@@ -142,5 +142,5 @@ func (n NullInt) Value() (driver.Value, error) {
142142
if !n.Valid {
143143
return nil, nil
144144
}
145-
return n.Int, nil
145+
return int64(n.Int), nil
146146
}

zero/int16.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"strconv"
99

10-
"github.com/pobri19/null-extended/convert"
10+
"gopkg.in/nullbio/null.v4/convert"
1111
)
1212

1313
type NullInt16 struct {
@@ -142,5 +142,5 @@ func (n NullInt16) Value() (driver.Value, error) {
142142
if !n.Valid {
143143
return nil, nil
144144
}
145-
return n.Int16, nil
145+
return int64(n.Int16), nil
146146
}

zero/int32.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"strconv"
99

10-
"github.com/pobri19/null-extended/convert"
10+
"gopkg.in/nullbio/null.v4/convert"
1111
)
1212

1313
type NullInt32 struct {
@@ -142,5 +142,5 @@ func (n NullInt32) Value() (driver.Value, error) {
142142
if !n.Valid {
143143
return nil, nil
144144
}
145-
return n.Int32, nil
145+
return int64(n.Int32), nil
146146
}

zero/int8.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"strconv"
99

10-
"github.com/pobri19/null-extended/convert"
10+
"gopkg.in/nullbio/null.v4/convert"
1111
)
1212

1313
type NullInt8 struct {
@@ -142,5 +142,5 @@ func (n NullInt8) Value() (driver.Value, error) {
142142
if !n.Valid {
143143
return nil, nil
144144
}
145-
return n.Int8, nil
145+
return int64(n.Int8), nil
146146
}

zero/uint.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"strconv"
99

10-
"github.com/pobri19/null-extended/convert"
10+
"gopkg.in/nullbio/null.v4/convert"
1111
)
1212

1313
type NullUint struct {
@@ -142,5 +142,5 @@ func (n NullUint) Value() (driver.Value, error) {
142142
if !n.Valid {
143143
return nil, nil
144144
}
145-
return n.Uint, nil
145+
return int64(n.Uint), nil
146146
}

zero/uint16.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"strconv"
99

10-
"github.com/pobri19/null-extended/convert"
10+
"gopkg.in/nullbio/null.v4/convert"
1111
)
1212

1313
type NullUint16 struct {
@@ -142,5 +142,5 @@ func (n NullUint16) Value() (driver.Value, error) {
142142
if !n.Valid {
143143
return nil, nil
144144
}
145-
return n.Uint16, nil
145+
return int64(n.Uint16), nil
146146
}

zero/uint32.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"strconv"
99

10-
"github.com/pobri19/null-extended/convert"
10+
"gopkg.in/nullbio/null.v4/convert"
1111
)
1212

1313
type NullUint32 struct {
@@ -142,5 +142,5 @@ func (n NullUint32) Value() (driver.Value, error) {
142142
if !n.Valid {
143143
return nil, nil
144144
}
145-
return n.Uint32, nil
145+
return int64(n.Uint32), nil
146146
}

zero/uint64.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"strconv"
99

10-
"github.com/pobri19/null-extended/convert"
10+
"gopkg.in/nullbio/null.v4/convert"
1111
)
1212

1313
// NullUint64 is a replica of sql.NullInt64 for uint64 types.
@@ -142,5 +142,5 @@ func (n NullUint64) Value() (driver.Value, error) {
142142
if !n.Valid {
143143
return nil, nil
144144
}
145-
return n.Uint64, nil
145+
return int64(n.Uint64), nil
146146
}

zero/uint8.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"reflect"
88
"strconv"
99

10-
"github.com/pobri19/null-extended/convert"
10+
"gopkg.in/nullbio/null.v4/convert"
1111
)
1212

1313
type NullUint8 struct {
@@ -142,5 +142,5 @@ func (n NullUint8) Value() (driver.Value, error) {
142142
if !n.Valid {
143143
return nil, nil
144144
}
145-
return n.Uint8, nil
145+
return int64(n.Uint8), nil
146146
}

0 commit comments

Comments
 (0)