rebase: bump the github-dependencies group with 2 updates

Bumps the github-dependencies group with 2 updates: [github.com/aws/aws-sdk-go-v2/service/sts](https://github.com/aws/aws-sdk-go-v2) and [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang).


Updates `github.com/aws/aws-sdk-go-v2/service/sts` from 1.30.7 to 1.31.1
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/service/s3/v1.31.1/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/mgn/v1.30.7...service/s3/v1.31.1)

Updates `github.com/prometheus/client_golang` from 1.20.3 to 1.20.4
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.3...v1.20.4)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/sts
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-dependencies
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2024-09-23 20:18:36 +00:00
committed by mergify[bot]
parent dbd8462bcc
commit 40ad4163cb
45 changed files with 1296 additions and 98 deletions

View File

@ -1,9 +1,11 @@
package smithy
import "maps"
// PropertiesReader provides an interface for reading metadata from the
// underlying metadata container.
type PropertiesReader interface {
Get(key interface{}) interface{}
Get(key any) any
}
// Properties provides storing and reading metadata values. Keys may be any
@ -12,14 +14,14 @@ type PropertiesReader interface {
// The zero value for a Properties instance is ready for reads/writes without
// any additional initialization.
type Properties struct {
values map[interface{}]interface{}
values map[any]any
}
// Get attempts to retrieve the value the key points to. Returns nil if the
// key was not found.
//
// Panics if key type is not comparable.
func (m *Properties) Get(key interface{}) interface{} {
func (m *Properties) Get(key any) any {
m.lazyInit()
return m.values[key]
}
@ -28,7 +30,7 @@ func (m *Properties) Get(key interface{}) interface{} {
// that key it will be replaced with the new value.
//
// Panics if the key type is not comparable.
func (m *Properties) Set(key, value interface{}) {
func (m *Properties) Set(key, value any) {
m.lazyInit()
m.values[key] = value
}
@ -36,7 +38,7 @@ func (m *Properties) Set(key, value interface{}) {
// Has returns whether the key exists in the metadata.
//
// Panics if the key type is not comparable.
func (m *Properties) Has(key interface{}) bool {
func (m *Properties) Has(key any) bool {
m.lazyInit()
_, ok := m.values[key]
return ok
@ -55,8 +57,13 @@ func (m *Properties) SetAll(other *Properties) {
}
}
// Values returns a shallow clone of the property set's values.
func (m *Properties) Values() map[any]any {
return maps.Clone(m.values)
}
func (m *Properties) lazyInit() {
if m.values == nil {
m.values = map[interface{}]interface{}{}
m.values = map[any]any{}
}
}