This commit is contained in:
@@ -67,7 +67,6 @@ func (p *Provider) Watch(ctx context.Context, callback config.WatchCallback, key
|
||||
return
|
||||
}
|
||||
p.logger(ctx, "callback %v:%v", key, err)
|
||||
|
||||
}
|
||||
oldVar = newVar
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package watcher_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
@@ -14,6 +14,8 @@ import (
|
||||
"gitoa.ru/go-4devs/config/value"
|
||||
)
|
||||
|
||||
var _ config.Provider = (*provider)(nil)
|
||||
|
||||
type provider struct {
|
||||
cnt int32
|
||||
}
|
||||
@@ -25,7 +27,7 @@ func (p *provider) Name() string {
|
||||
func (p *provider) Value(context.Context, ...string) (config.Value, error) {
|
||||
p.cnt++
|
||||
|
||||
return value.JString(fmt.Sprint(p.cnt)), nil
|
||||
return value.JString(strconv.Itoa(int(p.cnt))), nil
|
||||
}
|
||||
|
||||
func TestWatcher(t *testing.T) {
|
||||
@@ -57,6 +59,7 @@ func TestWatcher(t *testing.T) {
|
||||
},
|
||||
"tmpname",
|
||||
)
|
||||
|
||||
wg.Wait()
|
||||
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user