Correcting all go vet errors
This commit is contained in:
5
pkg/client/cache/expiration_cache_test.go
vendored
5
pkg/client/cache/expiration_cache_test.go
vendored
@@ -17,10 +17,11 @@ limitations under the License.
|
||||
package cache
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
)
|
||||
|
||||
func TestTTLExpirationBasic(t *testing.T) {
|
||||
@@ -111,7 +112,7 @@ func TestTTLPolicy(t *testing.T) {
|
||||
exactlyOnTTL := fakeTime.Add(-ttl)
|
||||
expiredTime := fakeTime.Add(-(ttl + 1))
|
||||
|
||||
policy := TTLPolicy{ttl, &util.FakeClock{fakeTime}}
|
||||
policy := TTLPolicy{ttl, &util.FakeClock{Time: fakeTime}}
|
||||
fakeTimestampedEntry := ×tampedEntry{obj: struct{}{}, timestamp: exactlyOnTTL}
|
||||
if policy.IsExpired(fakeTimestampedEntry) {
|
||||
t.Errorf("TTL cache should not expire entries exactly on ttl")
|
||||
|
6
pkg/client/cache/watch_cache.go
vendored
6
pkg/client/cache/watch_cache.go
vendored
@@ -86,7 +86,7 @@ func (w *WatchCache) Add(obj interface{}) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
event := watch.Event{watch.Added, object}
|
||||
event := watch.Event{Type: watch.Added, Object: object}
|
||||
|
||||
f := func(obj runtime.Object) error { return w.store.Add(obj) }
|
||||
return w.processEvent(event, resourceVersion, f)
|
||||
@@ -97,7 +97,7 @@ func (w *WatchCache) Update(obj interface{}) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
event := watch.Event{watch.Modified, object}
|
||||
event := watch.Event{Type: watch.Modified, Object: object}
|
||||
|
||||
f := func(obj runtime.Object) error { return w.store.Update(obj) }
|
||||
return w.processEvent(event, resourceVersion, f)
|
||||
@@ -108,7 +108,7 @@ func (w *WatchCache) Delete(obj interface{}) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
event := watch.Event{watch.Deleted, object}
|
||||
event := watch.Event{Type: watch.Deleted, Object: object}
|
||||
|
||||
f := func(obj runtime.Object) error { return w.store.Delete(obj) }
|
||||
return w.processEvent(event, resourceVersion, f)
|
||||
|
@@ -269,7 +269,7 @@ func TestGetListener(t *testing.T) {
|
||||
}
|
||||
|
||||
if listener == nil {
|
||||
t.Errorf("Test case #%d did not raised an error (%t) but failed in initializing listener", i, err)
|
||||
t.Errorf("Test case #%d did not raise an error but failed in initializing listener", i)
|
||||
continue
|
||||
}
|
||||
|
||||
|
@@ -600,8 +600,6 @@ func (r *Request) Stream() (io.ReadCloser, error) {
|
||||
bodyText := string(bodyBytes)
|
||||
return nil, fmt.Errorf("%s while accessing %v: %s", resp.Status, url, bodyText)
|
||||
}
|
||||
|
||||
return resp.Body, nil
|
||||
}
|
||||
|
||||
// Upgrade upgrades the request so that it supports multiplexed bidirectional
|
||||
|
@@ -1187,7 +1187,7 @@ func TestWatch(t *testing.T) {
|
||||
|
||||
encoder := watchjson.NewEncoder(w, latest.Codec)
|
||||
for _, item := range table {
|
||||
if err := encoder.Encode(&watch.Event{item.t, item.obj}); err != nil {
|
||||
if err := encoder.Encode(&watch.Event{Type: item.t, Object: item.obj}); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
flusher.Flush()
|
||||
|
@@ -76,8 +76,6 @@ func ObjectReaction(o ObjectRetriever, mapper meta.RESTMapper) ReactionFunc {
|
||||
default:
|
||||
return nil, fmt.Errorf("no reaction implemented for %s", action)
|
||||
}
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +173,7 @@ func (o objects) Kind(kind, name string) (runtime.Object, error) {
|
||||
status.Details.Kind = kind
|
||||
}
|
||||
if status.Status != api.StatusSuccess {
|
||||
return nilValue, &errors.StatusError{*status}
|
||||
return nilValue, &errors.StatusError{ErrStatus: *status}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user