aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/modern-go/reflect2/reflect2_kind.go
diff options
context:
space:
mode:
authorLibravatar Rutger Broekhoff2023-12-29 21:31:53 +0100
committerLibravatar Rutger Broekhoff2023-12-29 21:31:53 +0100
commit404aeae4545d2426c089a5f8d5e82dae56f5212b (patch)
tree2d84e00af272b39fc04f3795ae06bc48970e57b5 /vendor/github.com/modern-go/reflect2/reflect2_kind.go
parent209d8b0187ed025dec9ac149ebcced3462877bff (diff)
downloadgitolfs3-404aeae4545d2426c089a5f8d5e82dae56f5212b.tar.gz
gitolfs3-404aeae4545d2426c089a5f8d5e82dae56f5212b.zip
Make Nix builds work
Diffstat (limited to 'vendor/github.com/modern-go/reflect2/reflect2_kind.go')
-rw-r--r--vendor/github.com/modern-go/reflect2/reflect2_kind.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/vendor/github.com/modern-go/reflect2/reflect2_kind.go b/vendor/github.com/modern-go/reflect2/reflect2_kind.go
new file mode 100644
index 0000000..62f299e
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/reflect2_kind.go
@@ -0,0 +1,30 @@
1package reflect2
2
3import (
4 "reflect"
5 "unsafe"
6)
7
8// DefaultTypeOfKind return the non aliased default type for the kind
9func DefaultTypeOfKind(kind reflect.Kind) Type {
10 return kindTypes[kind]
11}
12
13var kindTypes = map[reflect.Kind]Type{
14 reflect.Bool: TypeOf(true),
15 reflect.Uint8: TypeOf(uint8(0)),
16 reflect.Int8: TypeOf(int8(0)),
17 reflect.Uint16: TypeOf(uint16(0)),
18 reflect.Int16: TypeOf(int16(0)),
19 reflect.Uint32: TypeOf(uint32(0)),
20 reflect.Int32: TypeOf(int32(0)),
21 reflect.Uint64: TypeOf(uint64(0)),
22 reflect.Int64: TypeOf(int64(0)),
23 reflect.Uint: TypeOf(uint(0)),
24 reflect.Int: TypeOf(int(0)),
25 reflect.Float32: TypeOf(float32(0)),
26 reflect.Float64: TypeOf(float64(0)),
27 reflect.Uintptr: TypeOf(uintptr(0)),
28 reflect.String: TypeOf(""),
29 reflect.UnsafePointer: TypeOf(unsafe.Pointer(nil)),
30}