From a1daa5d64abc4654c32d18090c1de28ff9c6cbd8 Mon Sep 17 00:00:00 2001 From: GuangZhan Date: Thu, 6 Jul 2023 11:14:23 +0800 Subject: [PATCH] chore: fix lint problem --- config/config.go | 2 +- config/config_test.go | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/config.go b/config/config.go index 0f62c5ba1f1..60b123695d5 100644 --- a/config/config.go +++ b/config/config.go @@ -61,7 +61,7 @@ func New(opts ...Option) Config { } func (c *config) watch(w Watcher) { - var reloadReader = func(opts options) (Reader, error) { + reloadReader := func(opts options) (Reader, error) { r := newReader(c.opts) for _, src := range c.opts.sources { kvs, err := src.Load() diff --git a/config/config_test.go b/config/config_test.go index e7c4d9a45a1..e329acf6bc4 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -198,27 +198,27 @@ func AssertStringValue(t *testing.T, expect any, v Value) bool { } func TestConfig_WatchBetweenSourcesReferenceConfig(t *testing.T) { - var testJson = ` + testJSON := ` { "foo": "${remote.foo}" } ` - var testJson2 = ` + testJSON2 := ` { "remote": { "foo": "bar" } } ` - var testJsonUpdate = ` + testJSONUpdate := ` { "remote": { "foo": "bar2" } } ` - var src1 = newTestJSONSource(testJson) - var src2 = newTestJSONSource(testJson2) + src1 := newTestJSONSource(testJSON) + src2 := newTestJSONSource(testJSON2) opts := options{ sources: []Source{src1, src2}, decoder: defaultDecoder, @@ -241,7 +241,7 @@ func TestConfig_WatchBetweenSourcesReferenceConfig(t *testing.T) { } // update remote.foo value - src2.data = testJsonUpdate + src2.data = testJSONUpdate src2.sig <- struct{}{} // wait for watch to finish src2.sig <- struct{}{}