Skip to content

Commit

Permalink
chore: fix lint problem
Browse files Browse the repository at this point in the history
  • Loading branch information
GuangZhan committed Jul 6, 2023
1 parent f2bf6bf commit a1daa5d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
12 changes: 6 additions & 6 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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{}{}
Expand Down

0 comments on commit a1daa5d

Please sign in to comment.