diff options
author | Rutger Broekhoff | 2023-12-29 21:31:53 +0100 |
---|---|---|
committer | Rutger Broekhoff | 2023-12-29 21:31:53 +0100 |
commit | 404aeae4545d2426c089a5f8d5e82dae56f5212b (patch) | |
tree | 2d84e00af272b39fc04f3795ae06bc48970e57b5 /vendor/github.com/modern-go/reflect2/reflect2_kind.go | |
parent | 209d8b0187ed025dec9ac149ebcced3462877bff (diff) | |
download | gitolfs3-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.go | 30 |
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 @@ | |||
1 | package reflect2 | ||
2 | |||
3 | import ( | ||
4 | "reflect" | ||
5 | "unsafe" | ||
6 | ) | ||
7 | |||
8 | // DefaultTypeOfKind return the non aliased default type for the kind | ||
9 | func DefaultTypeOfKind(kind reflect.Kind) Type { | ||
10 | return kindTypes[kind] | ||
11 | } | ||
12 | |||
13 | var 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 | } | ||