aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/aws/smithy-go/ptr
diff options
context:
space:
mode:
authorvitalyisaev <vitalyisaev@ydb.tech>2023-12-12 21:55:07 +0300
committervitalyisaev <vitalyisaev@ydb.tech>2023-12-12 22:25:10 +0300
commit4967f99474a4040ba150eb04995de06342252718 (patch)
treec9c118836513a8fab6e9fcfb25be5d404338bca7 /vendor/github.com/aws/smithy-go/ptr
parent2ce9cccb9b0bdd4cd7a3491dc5cbf8687cda51de (diff)
downloadydb-4967f99474a4040ba150eb04995de06342252718.tar.gz
YQ Connector: prepare code base for S3 integration
1. Кодовая база Коннектора переписана с помощью Go дженериков так, чтобы добавление нового источника данных (в частности S3 + csv) максимально переиспользовало имеющийся код (чтобы сохранялась логика нарезания на блоки данных, учёт трафика и пр.) 2. API Connector расширено для работы с S3, но ещё пока не протестировано.
Diffstat (limited to 'vendor/github.com/aws/smithy-go/ptr')
-rw-r--r--vendor/github.com/aws/smithy-go/ptr/doc.go5
-rw-r--r--vendor/github.com/aws/smithy-go/ptr/from_ptr.go601
-rw-r--r--vendor/github.com/aws/smithy-go/ptr/gotest/ya.make5
-rw-r--r--vendor/github.com/aws/smithy-go/ptr/to_ptr.go499
-rw-r--r--vendor/github.com/aws/smithy-go/ptr/to_ptr_test.go690
-rw-r--r--vendor/github.com/aws/smithy-go/ptr/ya.make17
6 files changed, 1817 insertions, 0 deletions
diff --git a/vendor/github.com/aws/smithy-go/ptr/doc.go b/vendor/github.com/aws/smithy-go/ptr/doc.go
new file mode 100644
index 0000000000..bc1f699616
--- /dev/null
+++ b/vendor/github.com/aws/smithy-go/ptr/doc.go
@@ -0,0 +1,5 @@
+// Package ptr provides utilities for converting scalar literal type values to and from pointers inline.
+package ptr
+
+//go:generate go run -tags codegen generate.go
+//go:generate gofmt -w -s .
diff --git a/vendor/github.com/aws/smithy-go/ptr/from_ptr.go b/vendor/github.com/aws/smithy-go/ptr/from_ptr.go
new file mode 100644
index 0000000000..a2845bb2c8
--- /dev/null
+++ b/vendor/github.com/aws/smithy-go/ptr/from_ptr.go
@@ -0,0 +1,601 @@
+// Code generated by smithy-go/ptr/generate.go DO NOT EDIT.
+package ptr
+
+import (
+ "time"
+)
+
+// ToBool returns bool value dereferenced if the passed
+// in pointer was not nil. Returns a bool zero value if the
+// pointer was nil.
+func ToBool(p *bool) (v bool) {
+ if p == nil {
+ return v
+ }
+
+ return *p
+}
+
+// ToBoolSlice returns a slice of bool values, that are
+// dereferenced if the passed in pointer was not nil. Returns a bool
+// zero value if the pointer was nil.
+func ToBoolSlice(vs []*bool) []bool {
+ ps := make([]bool, len(vs))
+ for i, v := range vs {
+ ps[i] = ToBool(v)
+ }
+
+ return ps
+}
+
+// ToBoolMap returns a map of bool values, that are
+// dereferenced if the passed in pointer was not nil. The bool
+// zero value is used if the pointer was nil.
+func ToBoolMap(vs map[string]*bool) map[string]bool {
+ ps := make(map[string]bool, len(vs))
+ for k, v := range vs {
+ ps[k] = ToBool(v)
+ }
+
+ return ps
+}
+
+// ToByte returns byte value dereferenced if the passed
+// in pointer was not nil. Returns a byte zero value if the
+// pointer was nil.
+func ToByte(p *byte) (v byte) {
+ if p == nil {
+ return v
+ }
+
+ return *p
+}
+
+// ToByteSlice returns a slice of byte values, that are
+// dereferenced if the passed in pointer was not nil. Returns a byte
+// zero value if the pointer was nil.
+func ToByteSlice(vs []*byte) []byte {
+ ps := make([]byte, len(vs))
+ for i, v := range vs {
+ ps[i] = ToByte(v)
+ }
+
+ return ps
+}
+
+// ToByteMap returns a map of byte values, that are
+// dereferenced if the passed in pointer was not nil. The byte
+// zero value is used if the pointer was nil.
+func ToByteMap(vs map[string]*byte) map[string]byte {
+ ps := make(map[string]byte, len(vs))
+ for k, v := range vs {
+ ps[k] = ToByte(v)
+ }
+
+ return ps
+}
+
+// ToString returns string value dereferenced if the passed
+// in pointer was not nil. Returns a string zero value if the
+// pointer was nil.
+func ToString(p *string) (v string) {
+ if p == nil {
+ return v
+ }
+
+ return *p
+}
+
+// ToStringSlice returns a slice of string values, that are
+// dereferenced if the passed in pointer was not nil. Returns a string
+// zero value if the pointer was nil.
+func ToStringSlice(vs []*string) []string {
+ ps := make([]string, len(vs))
+ for i, v := range vs {
+ ps[i] = ToString(v)
+ }
+
+ return ps
+}
+
+// ToStringMap returns a map of string values, that are
+// dereferenced if the passed in pointer was not nil. The string
+// zero value is used if the pointer was nil.
+func ToStringMap(vs map[string]*string) map[string]string {
+ ps := make(map[string]string, len(vs))
+ for k, v := range vs {
+ ps[k] = ToString(v)
+ }
+
+ return ps
+}
+
+// ToInt returns int value dereferenced if the passed
+// in pointer was not nil. Returns a int zero value if the
+// pointer was nil.
+func ToInt(p *int) (v int) {
+ if p == nil {
+ return v
+ }
+
+ return *p
+}
+
+// ToIntSlice returns a slice of int values, that are
+// dereferenced if the passed in pointer was not nil. Returns a int
+// zero value if the pointer was nil.
+func ToIntSlice(vs []*int) []int {
+ ps := make([]int, len(vs))
+ for i, v := range vs {
+ ps[i] = ToInt(v)
+ }
+
+ return ps
+}
+
+// ToIntMap returns a map of int values, that are
+// dereferenced if the passed in pointer was not nil. The int
+// zero value is used if the pointer was nil.
+func ToIntMap(vs map[string]*int) map[string]int {
+ ps := make(map[string]int, len(vs))
+ for k, v := range vs {
+ ps[k] = ToInt(v)
+ }
+
+ return ps
+}
+
+// ToInt8 returns int8 value dereferenced if the passed
+// in pointer was not nil. Returns a int8 zero value if the
+// pointer was nil.
+func ToInt8(p *int8) (v int8) {
+ if p == nil {
+ return v
+ }
+
+ return *p
+}
+
+// ToInt8Slice returns a slice of int8 values, that are
+// dereferenced if the passed in pointer was not nil. Returns a int8
+// zero value if the pointer was nil.
+func ToInt8Slice(vs []*int8) []int8 {
+ ps := make([]int8, len(vs))
+ for i, v := range vs {
+ ps[i] = ToInt8(v)
+ }
+
+ return ps
+}
+
+// ToInt8Map returns a map of int8 values, that are
+// dereferenced if the passed in pointer was not nil. The int8
+// zero value is used if the pointer was nil.
+func ToInt8Map(vs map[string]*int8) map[string]int8 {
+ ps := make(map[string]int8, len(vs))
+ for k, v := range vs {
+ ps[k] = ToInt8(v)
+ }
+
+ return ps
+}
+
+// ToInt16 returns int16 value dereferenced if the passed
+// in pointer was not nil. Returns a int16 zero value if the
+// pointer was nil.
+func ToInt16(p *int16) (v int16) {
+ if p == nil {
+ return v
+ }
+
+ return *p
+}
+
+// ToInt16Slice returns a slice of int16 values, that are
+// dereferenced if the passed in pointer was not nil. Returns a int16
+// zero value if the pointer was nil.
+func ToInt16Slice(vs []*int16) []int16 {
+ ps := make([]int16, len(vs))
+ for i, v := range vs {
+ ps[i] = ToInt16(v)
+ }
+
+ return ps
+}
+
+// ToInt16Map returns a map of int16 values, that are
+// dereferenced if the passed in pointer was not nil. The int16
+// zero value is used if the pointer was nil.
+func ToInt16Map(vs map[string]*int16) map[string]int16 {
+ ps := make(map[string]int16, len(vs))
+ for k, v := range vs {
+ ps[k] = ToInt16(v)
+ }
+
+ return ps
+}
+
+// ToInt32 returns int32 value dereferenced if the passed
+// in pointer was not nil. Returns a int32 zero value if the
+// pointer was nil.
+func ToInt32(p *int32) (v int32) {
+ if p == nil {
+ return v
+ }
+
+ return *p
+}
+
+// ToInt32Slice returns a slice of int32 values, that are
+// dereferenced if the passed in pointer was not nil. Returns a int32
+// zero value if the pointer was nil.
+func ToInt32Slice(vs []*int32) []int32 {
+ ps := make([]int32, len(vs))
+ for i, v := range vs {
+ ps[i] = ToInt32(v)
+ }
+
+ return ps
+}
+
+// ToInt32Map returns a map of int32 values, that are
+// dereferenced if the passed in pointer was not nil. The int32
+// zero value is used if the pointer was nil.
+func ToInt32Map(vs map[string]*int32) map[string]int32 {
+ ps := make(map[string]int32, len(vs))
+ for k, v := range vs {
+ ps[k] = ToInt32(v)
+ }
+
+ return ps
+}
+
+// ToInt64 returns int64 value dereferenced if the passed
+// in pointer was not nil. Returns a int64 zero value if the
+// pointer was nil.
+func ToInt64(p *int64) (v int64) {
+ if p == nil {
+ return v
+ }
+
+ return *p
+}
+
+// ToInt64Slice returns a slice of int64 values, that are
+// dereferenced if the passed in pointer was not nil. Returns a int64
+// zero value if the pointer was nil.
+func ToInt64Slice(vs []*int64) []int64 {
+ ps := make([]int64, len(vs))
+ for i, v := range vs {
+ ps[i] = ToInt64(v)
+ }
+
+ return ps
+}
+
+// ToInt64Map returns a map of int64 values, that are
+// dereferenced if the passed in pointer was not nil. The int64
+// zero value is used if the pointer was nil.
+func ToInt64Map(vs map[string]*int64) map[string]int64 {
+ ps := make(map[string]int64, len(vs))
+ for k, v := range vs {
+ ps[k] = ToInt64(v)
+ }
+
+ return ps
+}
+
+// ToUint returns uint value dereferenced if the passed
+// in pointer was not nil. Returns a uint zero value if the
+// pointer was nil.
+func ToUint(p *uint) (v uint) {
+ if p == nil {
+ return v
+ }
+
+ return *p
+}
+
+// ToUintSlice returns a slice of uint values, that are
+// dereferenced if the passed in pointer was not nil. Returns a uint
+// zero value if the pointer was nil.
+func ToUintSlice(vs []*uint) []uint {
+ ps := make([]uint, len(vs))
+ for i, v := range vs {
+ ps[i] = ToUint(v)
+ }
+
+ return ps
+}
+
+// ToUintMap returns a map of uint values, that are
+// dereferenced if the passed in pointer was not nil. The uint
+// zero value is used if the pointer was nil.
+func ToUintMap(vs map[string]*uint) map[string]uint {
+ ps := make(map[string]uint, len(vs))
+ for k, v := range vs {
+ ps[k] = ToUint(v)
+ }
+
+ return ps
+}
+
+// ToUint8 returns uint8 value dereferenced if the passed
+// in pointer was not nil. Returns a uint8 zero value if the
+// pointer was nil.
+func ToUint8(p *uint8) (v uint8) {
+ if p == nil {
+ return v
+ }
+
+ return *p
+}
+
+// ToUint8Slice returns a slice of uint8 values, that are
+// dereferenced if the passed in pointer was not nil. Returns a uint8
+// zero value if the pointer was nil.
+func ToUint8Slice(vs []*uint8) []uint8 {
+ ps := make([]uint8, len(vs))
+ for i, v := range vs {
+ ps[i] = ToUint8(v)
+ }
+
+ return ps
+}
+
+// ToUint8Map returns a map of uint8 values, that are
+// dereferenced if the passed in pointer was not nil. The uint8
+// zero value is used if the pointer was nil.
+func ToUint8Map(vs map[string]*uint8) map[string]uint8 {
+ ps := make(map[string]uint8, len(vs))
+ for k, v := range vs {
+ ps[k] = ToUint8(v)
+ }
+
+ return ps
+}
+
+// ToUint16 returns uint16 value dereferenced if the passed
+// in pointer was not nil. Returns a uint16 zero value if the
+// pointer was nil.
+func ToUint16(p *uint16) (v uint16) {
+ if p == nil {
+ return v
+ }
+
+ return *p
+}
+
+// ToUint16Slice returns a slice of uint16 values, that are
+// dereferenced if the passed in pointer was not nil. Returns a uint16
+// zero value if the pointer was nil.
+func ToUint16Slice(vs []*uint16) []uint16 {
+ ps := make([]uint16, len(vs))
+ for i, v := range vs {
+ ps[i] = ToUint16(v)
+ }
+
+ return ps
+}
+
+// ToUint16Map returns a map of uint16 values, that are
+// dereferenced if the passed in pointer was not nil. The uint16
+// zero value is used if the pointer was nil.
+func ToUint16Map(vs map[string]*uint16) map[string]uint16 {
+ ps := make(map[string]uint16, len(vs))
+ for k, v := range vs {
+ ps[k] = ToUint16(v)
+ }
+
+ return ps
+}
+
+// ToUint32 returns uint32 value dereferenced if the passed
+// in pointer was not nil. Returns a uint32 zero value if the
+// pointer was nil.
+func ToUint32(p *uint32) (v uint32) {
+ if p == nil {
+ return v
+ }
+
+ return *p
+}
+
+// ToUint32Slice returns a slice of uint32 values, that are
+// dereferenced if the passed in pointer was not nil. Returns a uint32
+// zero value if the pointer was nil.
+func ToUint32Slice(vs []*uint32) []uint32 {
+ ps := make([]uint32, len(vs))
+ for i, v := range vs {
+ ps[i] = ToUint32(v)
+ }
+
+ return ps
+}
+
+// ToUint32Map returns a map of uint32 values, that are
+// dereferenced if the passed in pointer was not nil. The uint32
+// zero value is used if the pointer was nil.
+func ToUint32Map(vs map[string]*uint32) map[string]uint32 {
+ ps := make(map[string]uint32, len(vs))
+ for k, v := range vs {
+ ps[k] = ToUint32(v)
+ }
+
+ return ps
+}
+
+// ToUint64 returns uint64 value dereferenced if the passed
+// in pointer was not nil. Returns a uint64 zero value if the
+// pointer was nil.
+func ToUint64(p *uint64) (v uint64) {
+ if p == nil {
+ return v
+ }
+
+ return *p
+}
+
+// ToUint64Slice returns a slice of uint64 values, that are
+// dereferenced if the passed in pointer was not nil. Returns a uint64
+// zero value if the pointer was nil.
+func ToUint64Slice(vs []*uint64) []uint64 {
+ ps := make([]uint64, len(vs))
+ for i, v := range vs {
+ ps[i] = ToUint64(v)
+ }
+
+ return ps
+}
+
+// ToUint64Map returns a map of uint64 values, that are
+// dereferenced if the passed in pointer was not nil. The uint64
+// zero value is used if the pointer was nil.
+func ToUint64Map(vs map[string]*uint64) map[string]uint64 {
+ ps := make(map[string]uint64, len(vs))
+ for k, v := range vs {
+ ps[k] = ToUint64(v)
+ }
+
+ return ps
+}
+
+// ToFloat32 returns float32 value dereferenced if the passed
+// in pointer was not nil. Returns a float32 zero value if the
+// pointer was nil.
+func ToFloat32(p *float32) (v float32) {
+ if p == nil {
+ return v
+ }
+
+ return *p
+}
+
+// ToFloat32Slice returns a slice of float32 values, that are
+// dereferenced if the passed in pointer was not nil. Returns a float32
+// zero value if the pointer was nil.
+func ToFloat32Slice(vs []*float32) []float32 {
+ ps := make([]float32, len(vs))
+ for i, v := range vs {
+ ps[i] = ToFloat32(v)
+ }
+
+ return ps
+}
+
+// ToFloat32Map returns a map of float32 values, that are
+// dereferenced if the passed in pointer was not nil. The float32
+// zero value is used if the pointer was nil.
+func ToFloat32Map(vs map[string]*float32) map[string]float32 {
+ ps := make(map[string]float32, len(vs))
+ for k, v := range vs {
+ ps[k] = ToFloat32(v)
+ }
+
+ return ps
+}
+
+// ToFloat64 returns float64 value dereferenced if the passed
+// in pointer was not nil. Returns a float64 zero value if the
+// pointer was nil.
+func ToFloat64(p *float64) (v float64) {
+ if p == nil {
+ return v
+ }
+
+ return *p
+}
+
+// ToFloat64Slice returns a slice of float64 values, that are
+// dereferenced if the passed in pointer was not nil. Returns a float64
+// zero value if the pointer was nil.
+func ToFloat64Slice(vs []*float64) []float64 {
+ ps := make([]float64, len(vs))
+ for i, v := range vs {
+ ps[i] = ToFloat64(v)
+ }
+
+ return ps
+}
+
+// ToFloat64Map returns a map of float64 values, that are
+// dereferenced if the passed in pointer was not nil. The float64
+// zero value is used if the pointer was nil.
+func ToFloat64Map(vs map[string]*float64) map[string]float64 {
+ ps := make(map[string]float64, len(vs))
+ for k, v := range vs {
+ ps[k] = ToFloat64(v)
+ }
+
+ return ps
+}
+
+// ToTime returns time.Time value dereferenced if the passed
+// in pointer was not nil. Returns a time.Time zero value if the
+// pointer was nil.
+func ToTime(p *time.Time) (v time.Time) {
+ if p == nil {
+ return v
+ }
+
+ return *p
+}
+
+// ToTimeSlice returns a slice of time.Time values, that are
+// dereferenced if the passed in pointer was not nil. Returns a time.Time
+// zero value if the pointer was nil.
+func ToTimeSlice(vs []*time.Time) []time.Time {
+ ps := make([]time.Time, len(vs))
+ for i, v := range vs {
+ ps[i] = ToTime(v)
+ }
+
+ return ps
+}
+
+// ToTimeMap returns a map of time.Time values, that are
+// dereferenced if the passed in pointer was not nil. The time.Time
+// zero value is used if the pointer was nil.
+func ToTimeMap(vs map[string]*time.Time) map[string]time.Time {
+ ps := make(map[string]time.Time, len(vs))
+ for k, v := range vs {
+ ps[k] = ToTime(v)
+ }
+
+ return ps
+}
+
+// ToDuration returns time.Duration value dereferenced if the passed
+// in pointer was not nil. Returns a time.Duration zero value if the
+// pointer was nil.
+func ToDuration(p *time.Duration) (v time.Duration) {
+ if p == nil {
+ return v
+ }
+
+ return *p
+}
+
+// ToDurationSlice returns a slice of time.Duration values, that are
+// dereferenced if the passed in pointer was not nil. Returns a time.Duration
+// zero value if the pointer was nil.
+func ToDurationSlice(vs []*time.Duration) []time.Duration {
+ ps := make([]time.Duration, len(vs))
+ for i, v := range vs {
+ ps[i] = ToDuration(v)
+ }
+
+ return ps
+}
+
+// ToDurationMap returns a map of time.Duration values, that are
+// dereferenced if the passed in pointer was not nil. The time.Duration
+// zero value is used if the pointer was nil.
+func ToDurationMap(vs map[string]*time.Duration) map[string]time.Duration {
+ ps := make(map[string]time.Duration, len(vs))
+ for k, v := range vs {
+ ps[k] = ToDuration(v)
+ }
+
+ return ps
+}
diff --git a/vendor/github.com/aws/smithy-go/ptr/gotest/ya.make b/vendor/github.com/aws/smithy-go/ptr/gotest/ya.make
new file mode 100644
index 0000000000..f4c182c739
--- /dev/null
+++ b/vendor/github.com/aws/smithy-go/ptr/gotest/ya.make
@@ -0,0 +1,5 @@
+GO_TEST_FOR(vendor/github.com/aws/smithy-go/ptr)
+
+LICENSE(Apache-2.0)
+
+END()
diff --git a/vendor/github.com/aws/smithy-go/ptr/to_ptr.go b/vendor/github.com/aws/smithy-go/ptr/to_ptr.go
new file mode 100644
index 0000000000..0bfbbecbdc
--- /dev/null
+++ b/vendor/github.com/aws/smithy-go/ptr/to_ptr.go
@@ -0,0 +1,499 @@
+// Code generated by smithy-go/ptr/generate.go DO NOT EDIT.
+package ptr
+
+import (
+ "time"
+)
+
+// Bool returns a pointer value for the bool value passed in.
+func Bool(v bool) *bool {
+ return &v
+}
+
+// BoolSlice returns a slice of bool pointers from the values
+// passed in.
+func BoolSlice(vs []bool) []*bool {
+ ps := make([]*bool, len(vs))
+ for i, v := range vs {
+ vv := v
+ ps[i] = &vv
+ }
+
+ return ps
+}
+
+// BoolMap returns a map of bool pointers from the values
+// passed in.
+func BoolMap(vs map[string]bool) map[string]*bool {
+ ps := make(map[string]*bool, len(vs))
+ for k, v := range vs {
+ vv := v
+ ps[k] = &vv
+ }
+
+ return ps
+}
+
+// Byte returns a pointer value for the byte value passed in.
+func Byte(v byte) *byte {
+ return &v
+}
+
+// ByteSlice returns a slice of byte pointers from the values
+// passed in.
+func ByteSlice(vs []byte) []*byte {
+ ps := make([]*byte, len(vs))
+ for i, v := range vs {
+ vv := v
+ ps[i] = &vv
+ }
+
+ return ps
+}
+
+// ByteMap returns a map of byte pointers from the values
+// passed in.
+func ByteMap(vs map[string]byte) map[string]*byte {
+ ps := make(map[string]*byte, len(vs))
+ for k, v := range vs {
+ vv := v
+ ps[k] = &vv
+ }
+
+ return ps
+}
+
+// String returns a pointer value for the string value passed in.
+func String(v string) *string {
+ return &v
+}
+
+// StringSlice returns a slice of string pointers from the values
+// passed in.
+func StringSlice(vs []string) []*string {
+ ps := make([]*string, len(vs))
+ for i, v := range vs {
+ vv := v
+ ps[i] = &vv
+ }
+
+ return ps
+}
+
+// StringMap returns a map of string pointers from the values
+// passed in.
+func StringMap(vs map[string]string) map[string]*string {
+ ps := make(map[string]*string, len(vs))
+ for k, v := range vs {
+ vv := v
+ ps[k] = &vv
+ }
+
+ return ps
+}
+
+// Int returns a pointer value for the int value passed in.
+func Int(v int) *int {
+ return &v
+}
+
+// IntSlice returns a slice of int pointers from the values
+// passed in.
+func IntSlice(vs []int) []*int {
+ ps := make([]*int, len(vs))
+ for i, v := range vs {
+ vv := v
+ ps[i] = &vv
+ }
+
+ return ps
+}
+
+// IntMap returns a map of int pointers from the values
+// passed in.
+func IntMap(vs map[string]int) map[string]*int {
+ ps := make(map[string]*int, len(vs))
+ for k, v := range vs {
+ vv := v
+ ps[k] = &vv
+ }
+
+ return ps
+}
+
+// Int8 returns a pointer value for the int8 value passed in.
+func Int8(v int8) *int8 {
+ return &v
+}
+
+// Int8Slice returns a slice of int8 pointers from the values
+// passed in.
+func Int8Slice(vs []int8) []*int8 {
+ ps := make([]*int8, len(vs))
+ for i, v := range vs {
+ vv := v
+ ps[i] = &vv
+ }
+
+ return ps
+}
+
+// Int8Map returns a map of int8 pointers from the values
+// passed in.
+func Int8Map(vs map[string]int8) map[string]*int8 {
+ ps := make(map[string]*int8, len(vs))
+ for k, v := range vs {
+ vv := v
+ ps[k] = &vv
+ }
+
+ return ps
+}
+
+// Int16 returns a pointer value for the int16 value passed in.
+func Int16(v int16) *int16 {
+ return &v
+}
+
+// Int16Slice returns a slice of int16 pointers from the values
+// passed in.
+func Int16Slice(vs []int16) []*int16 {
+ ps := make([]*int16, len(vs))
+ for i, v := range vs {
+ vv := v
+ ps[i] = &vv
+ }
+
+ return ps
+}
+
+// Int16Map returns a map of int16 pointers from the values
+// passed in.
+func Int16Map(vs map[string]int16) map[string]*int16 {
+ ps := make(map[string]*int16, len(vs))
+ for k, v := range vs {
+ vv := v
+ ps[k] = &vv
+ }
+
+ return ps
+}
+
+// Int32 returns a pointer value for the int32 value passed in.
+func Int32(v int32) *int32 {
+ return &v
+}
+
+// Int32Slice returns a slice of int32 pointers from the values
+// passed in.
+func Int32Slice(vs []int32) []*int32 {
+ ps := make([]*int32, len(vs))
+ for i, v := range vs {
+ vv := v
+ ps[i] = &vv
+ }
+
+ return ps
+}
+
+// Int32Map returns a map of int32 pointers from the values
+// passed in.
+func Int32Map(vs map[string]int32) map[string]*int32 {
+ ps := make(map[string]*int32, len(vs))
+ for k, v := range vs {
+ vv := v
+ ps[k] = &vv
+ }
+
+ return ps
+}
+
+// Int64 returns a pointer value for the int64 value passed in.
+func Int64(v int64) *int64 {
+ return &v
+}
+
+// Int64Slice returns a slice of int64 pointers from the values
+// passed in.
+func Int64Slice(vs []int64) []*int64 {
+ ps := make([]*int64, len(vs))
+ for i, v := range vs {
+ vv := v
+ ps[i] = &vv
+ }
+
+ return ps
+}
+
+// Int64Map returns a map of int64 pointers from the values
+// passed in.
+func Int64Map(vs map[string]int64) map[string]*int64 {
+ ps := make(map[string]*int64, len(vs))
+ for k, v := range vs {
+ vv := v
+ ps[k] = &vv
+ }
+
+ return ps
+}
+
+// Uint returns a pointer value for the uint value passed in.
+func Uint(v uint) *uint {
+ return &v
+}
+
+// UintSlice returns a slice of uint pointers from the values
+// passed in.
+func UintSlice(vs []uint) []*uint {
+ ps := make([]*uint, len(vs))
+ for i, v := range vs {
+ vv := v
+ ps[i] = &vv
+ }
+
+ return ps
+}
+
+// UintMap returns a map of uint pointers from the values
+// passed in.
+func UintMap(vs map[string]uint) map[string]*uint {
+ ps := make(map[string]*uint, len(vs))
+ for k, v := range vs {
+ vv := v
+ ps[k] = &vv
+ }
+
+ return ps
+}
+
+// Uint8 returns a pointer value for the uint8 value passed in.
+func Uint8(v uint8) *uint8 {
+ return &v
+}
+
+// Uint8Slice returns a slice of uint8 pointers from the values
+// passed in.
+func Uint8Slice(vs []uint8) []*uint8 {
+ ps := make([]*uint8, len(vs))
+ for i, v := range vs {
+ vv := v
+ ps[i] = &vv
+ }
+
+ return ps
+}
+
+// Uint8Map returns a map of uint8 pointers from the values
+// passed in.
+func Uint8Map(vs map[string]uint8) map[string]*uint8 {
+ ps := make(map[string]*uint8, len(vs))
+ for k, v := range vs {
+ vv := v
+ ps[k] = &vv
+ }
+
+ return ps
+}
+
+// Uint16 returns a pointer value for the uint16 value passed in.
+func Uint16(v uint16) *uint16 {
+ return &v
+}
+
+// Uint16Slice returns a slice of uint16 pointers from the values
+// passed in.
+func Uint16Slice(vs []uint16) []*uint16 {
+ ps := make([]*uint16, len(vs))
+ for i, v := range vs {
+ vv := v
+ ps[i] = &vv
+ }
+
+ return ps
+}
+
+// Uint16Map returns a map of uint16 pointers from the values
+// passed in.
+func Uint16Map(vs map[string]uint16) map[string]*uint16 {
+ ps := make(map[string]*uint16, len(vs))
+ for k, v := range vs {
+ vv := v
+ ps[k] = &vv
+ }
+
+ return ps
+}
+
+// Uint32 returns a pointer value for the uint32 value passed in.
+func Uint32(v uint32) *uint32 {
+ return &v
+}
+
+// Uint32Slice returns a slice of uint32 pointers from the values
+// passed in.
+func Uint32Slice(vs []uint32) []*uint32 {
+ ps := make([]*uint32, len(vs))
+ for i, v := range vs {
+ vv := v
+ ps[i] = &vv
+ }
+
+ return ps
+}
+
+// Uint32Map returns a map of uint32 pointers from the values
+// passed in.
+func Uint32Map(vs map[string]uint32) map[string]*uint32 {
+ ps := make(map[string]*uint32, len(vs))
+ for k, v := range vs {
+ vv := v
+ ps[k] = &vv
+ }
+
+ return ps
+}
+
+// Uint64 returns a pointer value for the uint64 value passed in.
+func Uint64(v uint64) *uint64 {
+ return &v
+}
+
+// Uint64Slice returns a slice of uint64 pointers from the values
+// passed in.
+func Uint64Slice(vs []uint64) []*uint64 {
+ ps := make([]*uint64, len(vs))
+ for i, v := range vs {
+ vv := v
+ ps[i] = &vv
+ }
+
+ return ps
+}
+
+// Uint64Map returns a map of uint64 pointers from the values
+// passed in.
+func Uint64Map(vs map[string]uint64) map[string]*uint64 {
+ ps := make(map[string]*uint64, len(vs))
+ for k, v := range vs {
+ vv := v
+ ps[k] = &vv
+ }
+
+ return ps
+}
+
+// Float32 returns a pointer value for the float32 value passed in.
+func Float32(v float32) *float32 {
+ return &v
+}
+
+// Float32Slice returns a slice of float32 pointers from the values
+// passed in.
+func Float32Slice(vs []float32) []*float32 {
+ ps := make([]*float32, len(vs))
+ for i, v := range vs {
+ vv := v
+ ps[i] = &vv
+ }
+
+ return ps
+}
+
+// Float32Map returns a map of float32 pointers from the values
+// passed in.
+func Float32Map(vs map[string]float32) map[string]*float32 {
+ ps := make(map[string]*float32, len(vs))
+ for k, v := range vs {
+ vv := v
+ ps[k] = &vv
+ }
+
+ return ps
+}
+
+// Float64 returns a pointer value for the float64 value passed in.
+func Float64(v float64) *float64 {
+ return &v
+}
+
+// Float64Slice returns a slice of float64 pointers from the values
+// passed in.
+func Float64Slice(vs []float64) []*float64 {
+ ps := make([]*float64, len(vs))
+ for i, v := range vs {
+ vv := v
+ ps[i] = &vv
+ }
+
+ return ps
+}
+
+// Float64Map returns a map of float64 pointers from the values
+// passed in.
+func Float64Map(vs map[string]float64) map[string]*float64 {
+ ps := make(map[string]*float64, len(vs))
+ for k, v := range vs {
+ vv := v
+ ps[k] = &vv
+ }
+
+ return ps
+}
+
+// Time returns a pointer value for the time.Time value passed in.
+func Time(v time.Time) *time.Time {
+ return &v
+}
+
+// TimeSlice returns a slice of time.Time pointers from the values
+// passed in.
+func TimeSlice(vs []time.Time) []*time.Time {
+ ps := make([]*time.Time, len(vs))
+ for i, v := range vs {
+ vv := v
+ ps[i] = &vv
+ }
+
+ return ps
+}
+
+// TimeMap returns a map of time.Time pointers from the values
+// passed in.
+func TimeMap(vs map[string]time.Time) map[string]*time.Time {
+ ps := make(map[string]*time.Time, len(vs))
+ for k, v := range vs {
+ vv := v
+ ps[k] = &vv
+ }
+
+ return ps
+}
+
+// Duration returns a pointer value for the time.Duration value passed in.
+func Duration(v time.Duration) *time.Duration {
+ return &v
+}
+
+// DurationSlice returns a slice of time.Duration pointers from the values
+// passed in.
+func DurationSlice(vs []time.Duration) []*time.Duration {
+ ps := make([]*time.Duration, len(vs))
+ for i, v := range vs {
+ vv := v
+ ps[i] = &vv
+ }
+
+ return ps
+}
+
+// DurationMap returns a map of time.Duration pointers from the values
+// passed in.
+func DurationMap(vs map[string]time.Duration) map[string]*time.Duration {
+ ps := make(map[string]*time.Duration, len(vs))
+ for k, v := range vs {
+ vv := v
+ ps[k] = &vv
+ }
+
+ return ps
+}
diff --git a/vendor/github.com/aws/smithy-go/ptr/to_ptr_test.go b/vendor/github.com/aws/smithy-go/ptr/to_ptr_test.go
new file mode 100644
index 0000000000..1ff10a7121
--- /dev/null
+++ b/vendor/github.com/aws/smithy-go/ptr/to_ptr_test.go
@@ -0,0 +1,690 @@
+package ptr
+
+import (
+ "testing"
+ "time"
+)
+
+func TestBool(t *testing.T) {
+ var v *bool
+ v = Bool(true)
+ if !*v {
+ t.Errorf("expected %t, but received %t", true, *v)
+ }
+ v = Bool(false)
+ if *v {
+ t.Errorf("expected %t, but received %t", false, *v)
+ }
+}
+
+func TestBoolSlice(t *testing.T) {
+ s := []bool{true, false}
+ ps := BoolSlice(s)
+ if len(ps) != 2 {
+ t.Errorf("expected %d, but received %d", 2, len(ps))
+ }
+ if !*ps[0] {
+ t.Errorf("expected %t, but received %t", true, *ps[0])
+ }
+ if *ps[1] {
+ t.Errorf("expected %t, but received %t", false, *ps[1])
+ }
+}
+
+func TestBoolMap(t *testing.T) {
+ s := map[string]bool{
+ "true": true,
+ "false": false,
+ }
+ ps := BoolMap(s)
+ if len(ps) != 2 {
+ t.Errorf("expected %d, but received %d", 2, len(ps))
+ }
+ if !*ps["true"] {
+ t.Errorf("expected %t, but received %t", true, *ps["true"])
+ }
+ if *ps["false"] {
+ t.Errorf("expected %t, but received %t", false, *ps["false"])
+ }
+}
+
+func TestByte(t *testing.T) {
+ v := Byte(42)
+ if *v != 42 {
+ t.Errorf("expected %d, but received %d", 42, *v)
+ }
+}
+
+func TestByteSlice(t *testing.T) {
+ s := []byte{1, 1, 2, 3, 5, 8, 13, 21}
+ ps := ByteSlice(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 8, len(ps))
+ }
+ if *ps[0] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps[0])
+ }
+ if *ps[7] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps[7])
+ }
+}
+
+func TestByteMap(t *testing.T) {
+ s := map[string]byte{
+ "F0": 1,
+ "F1": 1,
+ "F2": 2,
+ "F3": 3,
+ "F4": 5,
+ "F5": 8,
+ "F6": 13,
+ "F7": 21,
+ }
+ ps := ByteMap(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 2, len(ps))
+ }
+ if *ps["F0"] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps["F0"])
+ }
+ if *ps["F7"] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps["F7"])
+ }
+}
+
+func TestString(t *testing.T) {
+ v := String("foo")
+ if *v != "foo" {
+ t.Errorf("expected %q, but received %q", "foo", *v)
+ }
+}
+
+func TestStringSlice(t *testing.T) {
+ s := []string{"foo", "bar", "fizz", "buzz", "hoge", "fuga"}
+ ps := StringSlice(s)
+ if len(ps) != 6 {
+ t.Errorf("expected %d, but received %d", 6, len(ps))
+ }
+ if *ps[0] != "foo" {
+ t.Errorf("expected %q, but received %q", "foo", *ps[0])
+ }
+ if *ps[5] != "fuga" {
+ t.Errorf("expected %q, but received %q", "fuga", *ps[5])
+ }
+}
+
+func TestStringMap(t *testing.T) {
+ s := map[string]string{
+ "foo": "bar",
+ "fizz": "buzz",
+ "hoge": "fuga",
+ }
+ ps := StringMap(s)
+ if len(ps) != 3 {
+ t.Errorf("expected %d, but received %d", 3, len(ps))
+ }
+ if *ps["foo"] != "bar" {
+ t.Errorf("expected %q, but received %q", "foo", *ps["foo"])
+ }
+ if *ps["hoge"] != "fuga" {
+ t.Errorf("expected %q, but received %q", "fuga", *ps["hoge"])
+ }
+}
+
+func TestInt(t *testing.T) {
+ v := Int(42)
+ if *v != 42 {
+ t.Errorf("expected %d, but received %d", 42, *v)
+ }
+}
+
+func TestIntSlice(t *testing.T) {
+ s := []int{1, 1, 2, 3, 5, 8, 13, 21}
+ ps := IntSlice(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 8, len(ps))
+ }
+ if *ps[0] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps[0])
+ }
+ if *ps[7] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps[7])
+ }
+}
+
+func TestIntMap(t *testing.T) {
+ s := map[string]int{
+ "F0": 1,
+ "F1": 1,
+ "F2": 2,
+ "F3": 3,
+ "F4": 5,
+ "F5": 8,
+ "F6": 13,
+ "F7": 21,
+ }
+ ps := IntMap(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 2, len(ps))
+ }
+ if *ps["F0"] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps["F0"])
+ }
+ if *ps["F7"] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps["F7"])
+ }
+}
+
+func TestInt8(t *testing.T) {
+ v := Int8(42)
+ if *v != 42 {
+ t.Errorf("expected %d, but received %d", 42, *v)
+ }
+}
+
+func TestInt8Slice(t *testing.T) {
+ s := []int8{1, 1, 2, 3, 5, 8, 13, 21}
+ ps := Int8Slice(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 8, len(ps))
+ }
+ if *ps[0] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps[0])
+ }
+ if *ps[7] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps[7])
+ }
+}
+
+func TestInt8Map(t *testing.T) {
+ s := map[string]int8{
+ "F0": 1,
+ "F1": 1,
+ "F2": 2,
+ "F3": 3,
+ "F4": 5,
+ "F5": 8,
+ "F6": 13,
+ "F7": 21,
+ }
+ ps := Int8Map(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 2, len(ps))
+ }
+ if *ps["F0"] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps["F0"])
+ }
+ if *ps["F7"] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps["F7"])
+ }
+}
+
+func TestInt16(t *testing.T) {
+ v := Int16(42)
+ if *v != 42 {
+ t.Errorf("expected %d, but received %d", 42, *v)
+ }
+}
+
+func TestIntSlice16(t *testing.T) {
+ s := []int16{1, 1, 2, 3, 5, 8, 13, 21}
+ ps := Int16Slice(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 8, len(ps))
+ }
+ if *ps[0] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps[0])
+ }
+ if *ps[7] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps[7])
+ }
+}
+
+func TestInt16Map(t *testing.T) {
+ s := map[string]int16{
+ "F0": 1,
+ "F1": 1,
+ "F2": 2,
+ "F3": 3,
+ "F4": 5,
+ "F5": 8,
+ "F6": 13,
+ "F7": 21,
+ }
+ ps := Int16Map(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 2, len(ps))
+ }
+ if *ps["F0"] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps["F0"])
+ }
+ if *ps["F7"] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps["F7"])
+ }
+}
+
+func TestInt32(t *testing.T) {
+ v := Int32(42)
+ if *v != 42 {
+ t.Errorf("expected %d, but received %d", 42, *v)
+ }
+}
+
+func TestInt32Slice(t *testing.T) {
+ s := []int32{1, 1, 2, 3, 5, 8, 13, 21}
+ ps := Int32Slice(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 8, len(ps))
+ }
+ if *ps[0] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps[0])
+ }
+ if *ps[7] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps[7])
+ }
+}
+
+func TestInt32Map(t *testing.T) {
+ s := map[string]int32{
+ "F0": 1,
+ "F1": 1,
+ "F2": 2,
+ "F3": 3,
+ "F4": 5,
+ "F5": 8,
+ "F6": 13,
+ "F7": 21,
+ }
+ ps := Int32Map(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 2, len(ps))
+ }
+ if *ps["F0"] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps["F0"])
+ }
+ if *ps["F7"] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps["F7"])
+ }
+}
+
+func TestInt64(t *testing.T) {
+ v := Int64(42)
+ if *v != 42 {
+ t.Errorf("expected %d, but received %d", 42, *v)
+ }
+}
+
+func TestInt64Slice(t *testing.T) {
+ s := []int64{1, 1, 2, 3, 5, 8, 13, 21}
+ ps := Int64Slice(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 8, len(ps))
+ }
+ if *ps[0] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps[0])
+ }
+ if *ps[7] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps[7])
+ }
+}
+
+func TestInt64Map(t *testing.T) {
+ s := map[string]int64{
+ "F0": 1,
+ "F1": 1,
+ "F2": 2,
+ "F3": 3,
+ "F4": 5,
+ "F5": 8,
+ "F6": 13,
+ "F7": 21,
+ }
+ ps := Int64Map(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 2, len(ps))
+ }
+ if *ps["F0"] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps["F0"])
+ }
+ if *ps["F7"] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps["F7"])
+ }
+}
+
+func TestUint(t *testing.T) {
+ v := Uint(42)
+ if *v != 42 {
+ t.Errorf("expected %d, but received %d", 42, *v)
+ }
+}
+
+func TestUintSlice(t *testing.T) {
+ s := []uint{1, 1, 2, 3, 5, 8, 13, 21}
+ ps := UintSlice(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 8, len(ps))
+ }
+ if *ps[0] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps[0])
+ }
+ if *ps[7] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps[7])
+ }
+}
+
+func TestUintMap(t *testing.T) {
+ s := map[string]uint{
+ "F0": 1,
+ "F1": 1,
+ "F2": 2,
+ "F3": 3,
+ "F4": 5,
+ "F5": 8,
+ "F6": 13,
+ "F7": 21,
+ }
+ ps := UintMap(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 2, len(ps))
+ }
+ if *ps["F0"] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps["F0"])
+ }
+ if *ps["F7"] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps["F7"])
+ }
+}
+
+func TestUint8(t *testing.T) {
+ v := Uint8(42)
+ if *v != 42 {
+ t.Errorf("expected %d, but received %d", 42, *v)
+ }
+}
+
+func TestUint8Slice(t *testing.T) {
+ s := []uint8{1, 1, 2, 3, 5, 8, 13, 21}
+ ps := Uint8Slice(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 8, len(ps))
+ }
+ if *ps[0] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps[0])
+ }
+ if *ps[7] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps[7])
+ }
+}
+
+func TestUint8Map(t *testing.T) {
+ s := map[string]uint8{
+ "F0": 1,
+ "F1": 1,
+ "F2": 2,
+ "F3": 3,
+ "F4": 5,
+ "F5": 8,
+ "F6": 13,
+ "F7": 21,
+ }
+ ps := Uint8Map(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 2, len(ps))
+ }
+ if *ps["F0"] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps["F0"])
+ }
+ if *ps["F7"] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps["F7"])
+ }
+}
+
+func TestUint16(t *testing.T) {
+ v := Uint16(42)
+ if *v != 42 {
+ t.Errorf("expected %d, but received %d", 42, *v)
+ }
+}
+
+func TestUintSlice16(t *testing.T) {
+ s := []uint16{1, 1, 2, 3, 5, 8, 13, 21}
+ ps := Uint16Slice(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 8, len(ps))
+ }
+ if *ps[0] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps[0])
+ }
+ if *ps[7] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps[7])
+ }
+}
+
+func TestUint16Map(t *testing.T) {
+ s := map[string]uint{
+ "F0": 1,
+ "F1": 1,
+ "F2": 2,
+ "F3": 3,
+ "F4": 5,
+ "F5": 8,
+ "F6": 13,
+ "F7": 21,
+ }
+ ps := UintMap(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 2, len(ps))
+ }
+ if *ps["F0"] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps["F0"])
+ }
+ if *ps["F7"] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps["F7"])
+ }
+}
+
+func TestUint32(t *testing.T) {
+ v := Uint32(42)
+ if *v != 42 {
+ t.Errorf("expected %d, but received %d", 42, *v)
+ }
+}
+
+func TestUint32Slice(t *testing.T) {
+ s := []uint32{1, 1, 2, 3, 5, 8, 13, 21}
+ ps := Uint32Slice(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 8, len(ps))
+ }
+ if *ps[0] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps[0])
+ }
+ if *ps[7] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps[7])
+ }
+}
+
+func TestUint32Map(t *testing.T) {
+ s := map[string]uint32{
+ "F0": 1,
+ "F1": 1,
+ "F2": 2,
+ "F3": 3,
+ "F4": 5,
+ "F5": 8,
+ "F6": 13,
+ "F7": 21,
+ }
+ ps := Uint32Map(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 2, len(ps))
+ }
+ if *ps["F0"] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps["F0"])
+ }
+ if *ps["F7"] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps["F7"])
+ }
+}
+
+func TestUint64(t *testing.T) {
+ v := Uint64(42)
+ if *v != 42 {
+ t.Errorf("expected %d, but received %d", 42, *v)
+ }
+}
+
+func TestUint64Slice(t *testing.T) {
+ s := []uint64{1, 1, 2, 3, 5, 8, 13, 21}
+ ps := Uint64Slice(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 8, len(ps))
+ }
+ if *ps[0] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps[0])
+ }
+ if *ps[7] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps[7])
+ }
+}
+
+func TestUint64Map(t *testing.T) {
+ s := map[string]uint64{
+ "F0": 1,
+ "F1": 1,
+ "F2": 2,
+ "F3": 3,
+ "F4": 5,
+ "F5": 8,
+ "F6": 13,
+ "F7": 21,
+ }
+ ps := Uint64Map(s)
+ if len(ps) != 8 {
+ t.Errorf("expected %d, but received %d", 2, len(ps))
+ }
+ if *ps["F0"] != 1 {
+ t.Errorf("expected %d, but received %d", 1, *ps["F0"])
+ }
+ if *ps["F7"] != 21 {
+ t.Errorf("expected %d, but received %d", 21, *ps["F7"])
+ }
+}
+
+func TestFloat32(t *testing.T) {
+ v := Float32(0.5)
+ if *v != 0.5 {
+ t.Errorf("expected %f, but received %f", 0.5, *v)
+ }
+}
+
+func TestFloat32Slice(t *testing.T) {
+ s := []float32{0.5, 0.25, 0.125, 0.0625}
+ ps := Float32Slice(s)
+ if len(ps) != 4 {
+ t.Errorf("expected %d, but received %d", 4, len(ps))
+ }
+ if *ps[0] != 0.5 {
+ t.Errorf("expected %f, but received %f", 0.5, *ps[0])
+ }
+ if *ps[3] != 0.0625 {
+ t.Errorf("expected %f, but received %f", 0.0625, *ps[7])
+ }
+}
+
+func TestFloat32Map(t *testing.T) {
+ s := map[string]float32{
+ "F0": 0.5,
+ "F1": 0.25,
+ "F2": 0.125,
+ "F3": 0.0625,
+ }
+ ps := Float32Map(s)
+ if len(ps) != 4 {
+ t.Errorf("expected %d, but received %d", 4, len(ps))
+ }
+ if *ps["F0"] != 0.5 {
+ t.Errorf("expected %f, but received %f", 0.5, *ps["F0"])
+ }
+ if *ps["F3"] != 0.0625 {
+ t.Errorf("expected %f, but received %f", 0.0625, *ps["F3"])
+ }
+}
+
+func TestFloat64(t *testing.T) {
+ v := Float64(0.5)
+ if *v != 0.5 {
+ t.Errorf("expected %f, but received %f", 0.5, *v)
+ }
+}
+
+func TestFloat64Slice(t *testing.T) {
+ s := []float64{0.5, 0.25, 0.125, 0.0625}
+ ps := Float64Slice(s)
+ if len(ps) != 4 {
+ t.Errorf("expected %d, but received %d", 4, len(ps))
+ }
+ if *ps[0] != 0.5 {
+ t.Errorf("expected %f, but received %f", 0.5, *ps[0])
+ }
+ if *ps[3] != 0.0625 {
+ t.Errorf("expected %f, but received %f", 0.0625, *ps[7])
+ }
+}
+
+func TestFloat64Map(t *testing.T) {
+ s := map[string]float64{
+ "F0": 0.5,
+ "F1": 0.25,
+ "F2": 0.125,
+ "F3": 0.0625,
+ }
+ ps := Float64Map(s)
+ if len(ps) != 4 {
+ t.Errorf("expected %d, but received %d", 4, len(ps))
+ }
+ if *ps["F0"] != 0.5 {
+ t.Errorf("expected %f, but received %f", 0.5, *ps["F0"])
+ }
+ if *ps["F3"] != 0.0625 {
+ t.Errorf("expected %f, but received %f", 0.0625, *ps["F3"])
+ }
+}
+
+func TestTime(t *testing.T) {
+ v := Time(time.Unix(1234567890, 0))
+ if v.Unix() != 1234567890 {
+ t.Errorf("expected %d, but received %d", 1234567890, v.Unix())
+ }
+}
+
+func TestTimeSlice(t *testing.T) {
+ s := []time.Time{time.Unix(1234567890, 0), time.Unix(2147483647, 0)}
+ ps := TimeSlice(s)
+ if len(ps) != 2 {
+ t.Errorf("expected %d, but received %d", 2, len(ps))
+ }
+ if ps[0].Unix() != 1234567890 {
+ t.Errorf("expected %d, but received %d", 1234567890, ps[0].Unix())
+ }
+ if ps[1].Unix() != 2147483647 {
+ t.Errorf("expected %d, but received %d", 2147483647, ps[1].Unix())
+ }
+}
+
+func TestTimeMap(t *testing.T) {
+ s := map[string]time.Time{
+ "2009-02-13T23:31:30Z": time.Unix(1234567890, 0),
+ "2038-01-19T03:14:07Z": time.Unix(2147483647, 0),
+ }
+ ps := TimeMap(s)
+ if len(ps) != 2 {
+ t.Errorf("expected %d, but received %d", 2, len(ps))
+ }
+ if ps["2009-02-13T23:31:30Z"].Unix() != 1234567890 {
+ t.Errorf("expected %d, but received %d", 1234567890, ps["2009-02-13T23:31:30Z"].Unix())
+ }
+ if ps["2038-01-19T03:14:07Z"].Unix() != 2147483647 {
+ t.Errorf("expected %d, but received %d", 2147483647, ps["2038-01-19T03:14:07Z"].Unix())
+ }
+}
diff --git a/vendor/github.com/aws/smithy-go/ptr/ya.make b/vendor/github.com/aws/smithy-go/ptr/ya.make
new file mode 100644
index 0000000000..352df7fbcd
--- /dev/null
+++ b/vendor/github.com/aws/smithy-go/ptr/ya.make
@@ -0,0 +1,17 @@
+GO_LIBRARY()
+
+LICENSE(Apache-2.0)
+
+SRCS(
+ doc.go
+ from_ptr.go
+ to_ptr.go
+)
+
+GO_TEST_SRCS(to_ptr_test.go)
+
+END()
+
+RECURSE(
+ gotest
+)