chore: upgrade dependencies
This commit is contained in:
35
vendor/github.com/aws/smithy-go/ptr/from_ptr.go
generated
vendored
35
vendor/github.com/aws/smithy-go/ptr/from_ptr.go
generated
vendored
@@ -564,3 +564,38 @@ func ToTimeMap(vs map[string]*time.Time) map[string]time.Time {
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user