-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
/
types.go
30 lines (28 loc) · 1.01 KB
/
types.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
package reflex
import (
"encoding/json"
"fmt"
"net"
"reflect"
"time"
)
// Common reflect types for go standard data types.
var (
StringType = reflect.TypeOf("")
BytesType = reflect.TypeOf([]byte{})
IntType = reflect.TypeOf(int(0))
Int16Type = reflect.TypeOf(int16(0))
Int32Type = reflect.TypeOf(int32(0))
Int64Type = reflect.TypeOf(int64(0))
Float32Type = reflect.TypeOf(float32(0))
Float64Type = reflect.TypeOf(float64(0))
TimeType = reflect.TypeOf(time.Time{})
IpTyp = reflect.TypeOf(net.IP{})
JSONNumberTyp = reflect.TypeOf(json.Number(""))
StringerTyp = reflect.TypeOf((*fmt.Stringer)(nil)).Elem()
ArrayIntegerTyp = reflect.TypeOf([]int{})
ArrayStringTyp = reflect.TypeOf([]string{})
DoubleArrayIntegerTyp = reflect.TypeOf([][]int{})
DoubleArrayStringTyp = reflect.TypeOf([][]string{})
ErrTyp = reflect.TypeOf((*error)(nil)).Elem()
)