1
0
Fork 0

Small code enhancements

This commit is contained in:
Michael 2018-08-06 20:00:03 +02:00 committed by Traefiker Bot
parent 015cd7a3d0
commit 9cd47dd2aa
41 changed files with 187 additions and 85 deletions

View file

@ -44,7 +44,7 @@ func newKvClientMock(kvPairs []*store.KVPair, err error) *Mock {
}
func (s *Mock) Put(key string, value []byte, opts *store.WriteOptions) error {
return errors.New("Put not supported")
return errors.New("put not supported")
}
func (s *Mock) Get(key string, options *store.ReadOptions) (*store.KVPair, error) {
@ -60,7 +60,7 @@ func (s *Mock) Get(key string, options *store.ReadOptions) (*store.KVPair, error
}
func (s *Mock) Delete(key string) error {
return errors.New("Delete not supported")
return errors.New("delete not supported")
}
// Exists mock
@ -78,7 +78,7 @@ func (s *Mock) Exists(key string, options *store.ReadOptions) (bool, error) {
// Watch mock
func (s *Mock) Watch(key string, stopCh <-chan struct{}, options *store.ReadOptions) (<-chan *store.KVPair, error) {
return nil, errors.New("Watch not supported")
return nil, errors.New("watch not supported")
}
// WatchTree mock

View file

@ -5,6 +5,7 @@ import (
"time"
"github.com/abronan/valkeyrie/store"
"github.com/containous/traefik/log"
"github.com/containous/traefik/types"
)
@ -22,7 +23,9 @@ func TestKvWatchTree(t *testing.T) {
configChan := make(chan types.ConfigMessage)
go func() {
provider.watchKv(configChan, "prefix", make(chan bool, 1))
if err := provider.watchKv(configChan, "prefix", make(chan bool, 1)); err != nil {
log.Error(err)
}
}()
select {