-
Notifications
You must be signed in to change notification settings - Fork 14
/
util.go
53 lines (42 loc) · 825 Bytes
/
util.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package gobatis
import "time"
// PI64 to NullInt64
func PI64(i int64) *int64 {
return &i
}
// PS to NullString
func PS(s string) *string {
return &s
}
// PF64 to NullFloat64
func PF64(f float64) *float64 {
return &f
}
// PT to NullTime
func PT(t time.Time) *time.Time {
return &t
}
// NB to NullBool
func PB(b bool) *bool {
return &b
}
// NI64 to NullInt64
func NI64(i int64) NullInt64 {
return NullInt64{Int64: i, Valid: true}
}
// NS to NullString
func NS(s string) NullString {
return NullString{String: s, Valid: true}
}
// NF64 to NullFloat64
func NF64(f float64) NullFloat64 {
return NullFloat64{Float64: f, Valid: true}
}
// NT to NullTime
func NT(t time.Time) NullTime {
return NullTime{Time: t, Valid: true}
}
// NB to NullBool
func NB(b bool) NullBool {
return NullBool{Bool: b, Valid: true}
}