diff --git a/.golangci.yml b/.golangci.yml index f0928b95..2865c19e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -14,6 +14,10 @@ linters-settings: Use of this source code is governed by a MIT license found in the LICENSE file. goimports: local-prefixes: github.com/nil-go/konf + gosec: + excludes: + # Flags for potentially-unsafe casting of ints, similar problem to globally-disabled G103 + - G115 govet: enable: - shadow @@ -41,7 +45,7 @@ linters: - canonicalheader - containedctx - contextcheck - # copyloopvar // go 1.22 + - copyloopvar - cyclop - decorder # depguard @@ -54,7 +58,6 @@ linters: - errchkjson - errname - errorlint - - exportloopref - exhaustive # exhaustruct - fatcontext diff --git a/CHANGELOG.md b/CHANGELOG.md index e030d6ba..73f9840d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Removed + +- Remove support for Golang 1.21 (#457). + ## [1.2.2] - 2024-07-08 ### Fixed diff --git a/README.md b/README.md index 23f77703..1d904527 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,8 @@ becoming coupled to a particular configuration source. - [konf.OnChange](#usage) for registering callbacks while configuration changes. - [konf.Explain](#understand-the-configuration) for understanding where the configuration is loaded from. - [Various providers](#configuration-providers) for loading configuration from major clouds, - [AWS](examples/aws), [Azure](examples/azure), and [GCP](examples/gcp) with [Notifier](notifier) for notifying the changes of configuration. + [AWS](examples/aws), [Azure](examples/azure), and [GCP](examples/gcp) with [Notifier](notifier) for notifying the + changes of configuration. - [Zero dependencies](go.mod) in core module which supports loading configuration from environment variables,flags, and embed file system. @@ -112,6 +113,7 @@ while the configuration source(s) is managed "up stack" (e.g. in or near `main() Application developers can then switch configuration sources(s) as necessary. ## Change Notification + The providers for loading configuration from clouds periodically poll the configuration source. It also supports watching the changes of configuration using corresponding notifier. For example, the `sns` notifier notifies the changes of `appconfig` and `s3` provider: @@ -150,22 +152,24 @@ to monitor the status of configuration loading/watching, e.g. recording metrics. There are providers for the following configuration sources. -| Loader | Load From | Watch Changes | Notifier | -|:------------------------------------------|:----------------------------------------------------------------------------------------|:-------------:|:--------------------------| -| [`env`](provider/env) | environment variables | | | -| [`fs`](provider/fs) | [fs.FS](https://pkg.go.dev/io/fs) | | | -| [`file`](provider/file) | file | ✓ | | -| [`flag`](provider/flag) | [flag](https://pkg.go.dev/flag) | | | -| [`pflag`](provider/pflag) | [spf13/pflag](https://github.com/spf13/pflag) | | | -| [`appconfig`](provider/appconfig) | [AWS AppConfig](https://aws.amazon.com/systems-manager/features/appconfig/) | ✓ | [sns](notifier/sns) | -| [`s3`](provider/s3) | [AWS S3](https://aws.amazon.com/s3) | ✓ | [sns](notifier/sns) | -| [`parameterstore`](provider/parameterstore) | [AWS ParameterStore](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html) | ✓ | [sns](notifier/sns) | -| [`azappconfig`](provider/azappconfig) | [Azure App Configuration](https://azure.microsoft.com/en-us/products/app-configuration) | ✓ | [azservicebus](notifier/azservicebus) | -| [`azblob`](provider/azblob) | [Azure Blob Storage](https://azure.microsoft.com/en-us/products/storage/blobs) | ✓ | [azservicebus](notifier/azservicebus) | -| [`secretmanager`](provider/secretmanager) | [GCP Secret Manager](https://cloud.google.com/security/products/secret-manager) | ✓ | [pubsub](notifier/pubsub) | -| [`gcs`](provider/gcs) | [GCP Cloud Storage](https://cloud.google.com/storage) | ✓ | [pubsub](notifier/pubsub) | - -[cobra](https://github.com/spf13/cobra) is supported through the [`pflag`](provider/pflag) loader, with the [`pflag.WithFlagSet`](https://pkg.go.dev/github.com/nil-go/konf/provider/pflag#WithFlagSet) option: +| Loader | Load From | Watch Changes | Notifier | +|:--------------------------------------------|:------------------------------------------------------------------------------------------------------------------------|:-------------:|:--------------------------------------| +| [`env`](provider/env) | environment variables | | | +| [`fs`](provider/fs) | [fs.FS](https://pkg.go.dev/io/fs) | | | +| [`file`](provider/file) | file | ✓ | | +| [`flag`](provider/flag) | [flag](https://pkg.go.dev/flag) | | | +| [`pflag`](provider/pflag) | [spf13/pflag](https://github.com/spf13/pflag) | | | +| [`appconfig`](provider/appconfig) | [AWS AppConfig](https://aws.amazon.com/systems-manager/features/appconfig/) | ✓ | [sns](notifier/sns) | +| [`s3`](provider/s3) | [AWS S3](https://aws.amazon.com/s3) | ✓ | [sns](notifier/sns) | +| [`parameterstore`](provider/parameterstore) | [AWS ParameterStore](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html) | ✓ | [sns](notifier/sns) | +| [`azappconfig`](provider/azappconfig) | [Azure App Configuration](https://azure.microsoft.com/en-us/products/app-configuration) | ✓ | [azservicebus](notifier/azservicebus) | +| [`azblob`](provider/azblob) | [Azure Blob Storage](https://azure.microsoft.com/en-us/products/storage/blobs) | ✓ | [azservicebus](notifier/azservicebus) | +| [`secretmanager`](provider/secretmanager) | [GCP Secret Manager](https://cloud.google.com/security/products/secret-manager) | ✓ | [pubsub](notifier/pubsub) | +| [`gcs`](provider/gcs) | [GCP Cloud Storage](https://cloud.google.com/storage) | ✓ | [pubsub](notifier/pubsub) | + +[cobra](https://github.com/spf13/cobra) is supported through the [`pflag`](provider/pflag) loader, with the [ +`pflag.WithFlagSet`](https://pkg.go.dev/github.com/nil-go/konf/provider/pflag#WithFlagSet) option: + ```go config.Load(kflag.New(&config, kflag.WithFlagSet(yourCobraCmd.Flags()))) ``` diff --git a/benchmark/go.mod b/benchmark/go.mod index 7f781b77..065a01f4 100644 --- a/benchmark/go.mod +++ b/benchmark/go.mod @@ -1,6 +1,6 @@ module github.com/nil-go/konf/benchmark -go 1.21 +go 1.22 require ( github.com/knadh/koanf/providers/env v0.1.0 diff --git a/config_test.go b/config_test.go index 8910ce61..126cc16e 100644 --- a/config_test.go +++ b/config_test.go @@ -49,8 +49,6 @@ func TestConfig_Load(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() @@ -260,8 +258,6 @@ func TestConfig_Unmarshal(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() @@ -355,8 +351,6 @@ Here are other value(loader)s: } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/go.mod b/go.mod index d9737877..5dba8b17 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/nil-go/konf -go 1.21 +go 1.22 retract v0.6.1 // It does not work while file is not exist diff --git a/internal/convert/converter_test.go b/internal/convert/converter_test.go index 2a5e570c..9937d573 100644 --- a/internal/convert/converter_test.go +++ b/internal/convert/converter_test.go @@ -924,8 +924,6 @@ func TestConverter(t *testing.T) { //nolint:maintidx } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/internal/convert/option.go b/internal/convert/option.go index 7437e6a7..f65ee3fc 100644 --- a/internal/convert/option.go +++ b/internal/convert/option.go @@ -46,8 +46,8 @@ func withHookFunc[F, T any](hookFunc func(F, T) error) Option { } options.hooks = append(options.hooks, hook{ - fromType: reflect.TypeOf((*F)(nil)).Elem(), - toType: reflect.TypeOf((*T)(nil)).Elem(), + fromType: reflect.TypeFor[F](), + toType: reflect.TypeFor[T](), hook: func(f, t any) error { from, ok := f.(F) if !ok { diff --git a/internal/maps/insert_test.go b/internal/maps/insert_test.go index b17250cc..ca360a49 100644 --- a/internal/maps/insert_test.go +++ b/internal/maps/insert_test.go @@ -62,8 +62,6 @@ func TestInsert(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/internal/maps/merge_test.go b/internal/maps/merge_test.go index bfa2decc..16911867 100644 --- a/internal/maps/merge_test.go +++ b/internal/maps/merge_test.go @@ -76,8 +76,6 @@ func TestMerge(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/internal/maps/sub_test.go b/internal/maps/sub_test.go index 1e13a855..cef809c0 100644 --- a/internal/maps/sub_test.go +++ b/internal/maps/sub_test.go @@ -81,13 +81,12 @@ func TestSub(t *testing.T) { }, } - for _, tc := range testcases { - tc := tc - t.Run(tc.description, func(t *testing.T) { + for _, testcase := range testcases { + t.Run(testcase.description, func(t *testing.T) { t.Parallel() - actual := maps.Sub(tc.values, tc.path, ".") - assert.Equal(t, tc.expected, actual) + actual := maps.Sub(testcase.values, testcase.path, ".") + assert.Equal(t, testcase.expected, actual) }) } } diff --git a/internal/maps/transform_test.go b/internal/maps/transform_test.go index f70ffbb9..7b15c198 100644 --- a/internal/maps/transform_test.go +++ b/internal/maps/transform_test.go @@ -45,13 +45,12 @@ func TestTransformKeys(t *testing.T) { }, } - for _, tc := range testcases { - tc := tc - t.Run(tc.description, func(t *testing.T) { + for _, testcase := range testcases { + t.Run(testcase.description, func(t *testing.T) { t.Parallel() - maps.TransformKeys(tc.src, tc.keyMap, tc.mapKeyCaseSensitive) - assert.Equal(t, tc.expected, tc.src) + maps.TransformKeys(testcase.src, testcase.keyMap, testcase.mapKeyCaseSensitive) + assert.Equal(t, testcase.expected, testcase.src) }) } } diff --git a/internal/nocopy.go b/internal/nocopy.go index 09958a62..b024d714 100644 --- a/internal/nocopy.go +++ b/internal/nocopy.go @@ -17,6 +17,6 @@ func (c *NoCopy[T]) Check() { } if c.addr != c { - panic("illegal use of non-zero " + reflect.TypeOf((*T)(nil)).Elem().Name() + " copied by value") + panic("illegal use of non-zero " + reflect.TypeFor[T]().Name() + " copied by value") } } diff --git a/notifier/azservicebus/go.mod b/notifier/azservicebus/go.mod index 00019171..db4d138b 100644 --- a/notifier/azservicebus/go.mod +++ b/notifier/azservicebus/go.mod @@ -1,6 +1,6 @@ module github.com/nil-go/konf/notifier/azservicebus -go 1.21 +go 1.22 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 diff --git a/notifier/pubsub/go.mod b/notifier/pubsub/go.mod index f4c09004..2a3da195 100644 --- a/notifier/pubsub/go.mod +++ b/notifier/pubsub/go.mod @@ -1,6 +1,6 @@ module github.com/nil-go/konf/notifier/pubsub -go 1.21 +go 1.22 require ( cloud.google.com/go/compute/metadata v0.5.0 diff --git a/notifier/pubsub/notifier_test.go b/notifier/pubsub/notifier_test.go index 0b72f2fd..3508c874 100644 --- a/notifier/pubsub/notifier_test.go +++ b/notifier/pubsub/notifier_test.go @@ -91,7 +91,6 @@ level=WARN msg="Fail to delete pubsub subscription." topic=topic subscription=pr } for _, testcase := range testcases { - testcase := testcase t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/notifier/sns/go.mod b/notifier/sns/go.mod index 495e2526..d2e1f0ae 100644 --- a/notifier/sns/go.mod +++ b/notifier/sns/go.mod @@ -1,6 +1,6 @@ module github.com/nil-go/konf/notifier/sns -go 1.21 +go 1.22 require ( github.com/aws/aws-sdk-go-v2 v1.30.4 diff --git a/notifier/sns/notifier_test.go b/notifier/sns/notifier_test.go index 23c920f7..1bd10ced 100644 --- a/notifier/sns/notifier_test.go +++ b/notifier/sns/notifier_test.go @@ -767,7 +767,6 @@ level=WARN msg="Fail to delete sqs message." queue=https://sqs.us-west-2.amazona } for _, testcase := range testcases { - testcase := testcase t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/provider/appconfig/appconfig_test.go b/provider/appconfig/appconfig_test.go index 1af5e695..74e0fa1d 100644 --- a/provider/appconfig/appconfig_test.go +++ b/provider/appconfig/appconfig_test.go @@ -158,8 +158,6 @@ func TestAppConfig_Load(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() @@ -676,8 +674,6 @@ func TestAppConfig_Watch(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/provider/appconfig/go.mod b/provider/appconfig/go.mod index c624c39c..8214d478 100644 --- a/provider/appconfig/go.mod +++ b/provider/appconfig/go.mod @@ -1,6 +1,6 @@ module github.com/nil-go/konf/provider/appconfig -go 1.21 +go 1.22 require ( github.com/aws/aws-sdk-go-v2 v1.30.4 diff --git a/provider/azappconfig/appconfig_test.go b/provider/azappconfig/appconfig_test.go index fc0e9570..0f7d6810 100644 --- a/provider/azappconfig/appconfig_test.go +++ b/provider/azappconfig/appconfig_test.go @@ -113,8 +113,6 @@ func TestAppConfig_Load(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() @@ -216,8 +214,6 @@ list settings error } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/provider/azappconfig/go.mod b/provider/azappconfig/go.mod index 8f045e98..e6cbac6e 100644 --- a/provider/azappconfig/go.mod +++ b/provider/azappconfig/go.mod @@ -1,6 +1,6 @@ module github.com/nil-go/konf/provider/azappconfig -go 1.21 +go 1.22 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 diff --git a/provider/azappconfig/internal/maps/insert_test.go b/provider/azappconfig/internal/maps/insert_test.go index ff129dfc..d771fe0f 100644 --- a/provider/azappconfig/internal/maps/insert_test.go +++ b/provider/azappconfig/internal/maps/insert_test.go @@ -62,8 +62,6 @@ func TestInsert(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/provider/azblob/blob_test.go b/provider/azblob/blob_test.go index 7bc137ab..c00116ab 100644 --- a/provider/azblob/blob_test.go +++ b/provider/azblob/blob_test.go @@ -45,8 +45,6 @@ func TestBlob_Load(t *testing.T) { t.Parallel() for _, testcase := range testcases() { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() @@ -77,8 +75,6 @@ func TestBlob_Watch(t *testing.T) { t.Parallel() for _, testcase := range append(testcases(), watchcases()...) { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/provider/azblob/go.mod b/provider/azblob/go.mod index af358215..51f37052 100644 --- a/provider/azblob/go.mod +++ b/provider/azblob/go.mod @@ -1,6 +1,6 @@ module github.com/nil-go/konf/provider/azblob -go 1.21 +go 1.22 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 diff --git a/provider/env/env_test.go b/provider/env/env_test.go index 6b428380..714f9c89 100644 --- a/provider/env/env_test.go +++ b/provider/env/env_test.go @@ -75,8 +75,6 @@ func TestEnv_Load(t *testing.T) { t.Setenv("P.N", "") for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { values, err := env.New(testcase.opts...).Load() assert.NoError(t, err) @@ -105,8 +103,6 @@ func TestEnv_String(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/provider/file/file_test.go b/provider/file/file_test.go index 7ec6c60e..108a47be 100644 --- a/provider/file/file_test.go +++ b/provider/file/file_test.go @@ -61,8 +61,6 @@ func TestFile_Load(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/provider/file/go.mod b/provider/file/go.mod index 1d93187f..f01119c0 100644 --- a/provider/file/go.mod +++ b/provider/file/go.mod @@ -1,6 +1,6 @@ module github.com/nil-go/konf/provider/file -go 1.21 +go 1.22 require github.com/fsnotify/fsnotify v1.7.0 diff --git a/provider/file/watch_test.go b/provider/file/watch_test.go index 22d69f81..3b79cb1d 100644 --- a/provider/file/watch_test.go +++ b/provider/file/watch_test.go @@ -44,8 +44,6 @@ func TestFile_Watch(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { tmpFile := path.Join(t.TempDir(), "watch.json") assert.NoError(t, os.WriteFile(tmpFile, []byte(`{"p": {"k": "v"}}`), 0o600)) diff --git a/provider/flag/flag_test.go b/provider/flag/flag_test.go index dad397fa..db5caa9e 100644 --- a/provider/flag/flag_test.go +++ b/provider/flag/flag_test.go @@ -103,8 +103,6 @@ func TestFlag_Load(t *testing.T) { parse() for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() @@ -135,8 +133,6 @@ func TestFlag_String(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/provider/fs/fs_test.go b/provider/fs/fs_test.go index 8790c1d7..0b9829d1 100644 --- a/provider/fs/fs_test.go +++ b/provider/fs/fs_test.go @@ -91,8 +91,6 @@ func TestFS_Load(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/provider/gcs/gcs_test.go b/provider/gcs/gcs_test.go index 056a1337..51e55697 100644 --- a/provider/gcs/gcs_test.go +++ b/provider/gcs/gcs_test.go @@ -36,8 +36,6 @@ func TestGCS_Load(t *testing.T) { t.Parallel() for _, testcase := range testcases() { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() @@ -76,8 +74,6 @@ func TestGCS_Watch(t *testing.T) { t.Parallel() for _, testcase := range append(testcases(), watchcases()...) { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/provider/gcs/go.mod b/provider/gcs/go.mod index 6cd5c695..41757e99 100644 --- a/provider/gcs/go.mod +++ b/provider/gcs/go.mod @@ -1,6 +1,6 @@ module github.com/nil-go/konf/provider/gcs -go 1.21 +go 1.22 require ( cloud.google.com/go/storage v1.43.0 diff --git a/provider/parameterstore/go.mod b/provider/parameterstore/go.mod index b7df9c36..39639959 100644 --- a/provider/parameterstore/go.mod +++ b/provider/parameterstore/go.mod @@ -1,6 +1,6 @@ module github.com/nil-go/konf/provider/parameterstore -go 1.21 +go 1.22 require ( github.com/aws/aws-sdk-go-v2 v1.30.4 diff --git a/provider/parameterstore/internal/maps/insert_test.go b/provider/parameterstore/internal/maps/insert_test.go index b7ed9d6f..510f6da1 100644 --- a/provider/parameterstore/internal/maps/insert_test.go +++ b/provider/parameterstore/internal/maps/insert_test.go @@ -62,8 +62,6 @@ func TestInsert(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/provider/parameterstore/parameterstore_test.go b/provider/parameterstore/parameterstore_test.go index 8c629d53..f9988b0b 100644 --- a/provider/parameterstore/parameterstore_test.go +++ b/provider/parameterstore/parameterstore_test.go @@ -36,8 +36,6 @@ func TestParameterStore_Load(t *testing.T) { t.Parallel() for _, testcase := range testcases() { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() @@ -75,8 +73,6 @@ func TestParameterStore_Watch(t *testing.T) { t.Parallel() for _, testcase := range append(testcases(), watchcases()...) { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/provider/pflag/go.mod b/provider/pflag/go.mod index 7248789d..4e9dca28 100644 --- a/provider/pflag/go.mod +++ b/provider/pflag/go.mod @@ -1,5 +1,5 @@ module github.com/nil-go/konf/provider/pflag -go 1.21 +go 1.22 require github.com/spf13/pflag v1.0.5 diff --git a/provider/pflag/internal/maps/insert_test.go b/provider/pflag/internal/maps/insert_test.go index dabb974f..08aeae07 100644 --- a/provider/pflag/internal/maps/insert_test.go +++ b/provider/pflag/internal/maps/insert_test.go @@ -62,8 +62,6 @@ func TestInsert(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/provider/pflag/pflag_test.go b/provider/pflag/pflag_test.go index 137d904f..3c363334 100644 --- a/provider/pflag/pflag_test.go +++ b/provider/pflag/pflag_test.go @@ -108,8 +108,6 @@ func TestPFlag_Load(t *testing.T) { pflag.CommandLine.SortFlags = false pflag.CommandLine.AddGoFlagSet(flag.CommandLine) for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() @@ -140,8 +138,6 @@ func TestPFlag_String(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/provider/s3/go.mod b/provider/s3/go.mod index cf2d246d..3c6f5e85 100644 --- a/provider/s3/go.mod +++ b/provider/s3/go.mod @@ -1,6 +1,6 @@ module github.com/nil-go/konf/provider/s3 -go 1.21 +go 1.22 require ( github.com/aws/aws-sdk-go-v2 v1.30.4 diff --git a/provider/s3/s3_test.go b/provider/s3/s3_test.go index d5654f4d..3d2f1b4a 100644 --- a/provider/s3/s3_test.go +++ b/provider/s3/s3_test.go @@ -37,8 +37,6 @@ func TestS3_Load(t *testing.T) { t.Parallel() for _, testcase := range testcases() { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() @@ -77,8 +75,6 @@ func TestS3_Watch(t *testing.T) { t.Parallel() for _, testcase := range append(testcases(), watchcases()...) { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/provider/secretmanager/go.mod b/provider/secretmanager/go.mod index c8bbc0c2..06069f9c 100644 --- a/provider/secretmanager/go.mod +++ b/provider/secretmanager/go.mod @@ -1,6 +1,6 @@ module github.com/nil-go/konf/provider/secretmanager -go 1.21 +go 1.22 require ( cloud.google.com/go/compute/metadata v0.5.0 diff --git a/provider/secretmanager/internal/maps/insert_test.go b/provider/secretmanager/internal/maps/insert_test.go index 6c94d78d..1ce5d875 100644 --- a/provider/secretmanager/internal/maps/insert_test.go +++ b/provider/secretmanager/internal/maps/insert_test.go @@ -62,8 +62,6 @@ func TestInsert(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/provider/secretmanager/secretmanager.go b/provider/secretmanager/secretmanager.go index e85017bc..aa901e5a 100644 --- a/provider/secretmanager/secretmanager.go +++ b/provider/secretmanager/secretmanager.go @@ -247,8 +247,6 @@ func (p *clientProxy) load(ctx context.Context) (map[string]string, bool, error) var waitGroup sync.WaitGroup waitGroup.Add(len(eTags)) for name := range eTags { - name := name - go func() { defer waitGroup.Done() diff --git a/provider/secretmanager/secretmanager_test.go b/provider/secretmanager/secretmanager_test.go index b308919c..2126519d 100644 --- a/provider/secretmanager/secretmanager_test.go +++ b/provider/secretmanager/secretmanager_test.go @@ -125,8 +125,6 @@ func TestSecretManager_Load(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() @@ -250,8 +248,6 @@ func TestSecretManager_Watch(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel() diff --git a/watch_test.go b/watch_test.go index c9247d4a..28cbc248 100644 --- a/watch_test.go +++ b/watch_test.go @@ -210,8 +210,6 @@ func TestConfig_Watch_panic(t *testing.T) { } for _, testcase := range testcases { - testcase := testcase - t.Run(testcase.description, func(t *testing.T) { t.Parallel()