@@ -48,16 +48,16 @@ func TestDecoder(t *testing.T) {
48
48
out , in := io .Pipe ()
49
49
50
50
decoder := restclientwatch .NewDecoder (streaming .NewDecoder (out , getDecoder ()), getDecoder ())
51
-
52
51
expect := & v1.Pod {ObjectMeta : metav1.ObjectMeta {Name : "foo" }}
53
52
encoder := json .NewEncoder (in )
53
+ eType := eventType
54
54
go func () {
55
55
data , err := runtime .Encode (scheme .Codecs .LegacyCodec (v1 .SchemeGroupVersion ), expect )
56
56
if err != nil {
57
57
t .Fatalf ("Unexpected error %v" , err )
58
58
}
59
59
event := metav1.WatchEvent {
60
- Type : string (eventType ),
60
+ Type : string (eType ),
61
61
Object : runtime.RawExtension {Raw : json .RawMessage (data )},
62
62
}
63
63
if err := encoder .Encode (& event ); err != nil {
@@ -72,7 +72,7 @@ func TestDecoder(t *testing.T) {
72
72
if err != nil {
73
73
t .Fatalf ("Unexpected error %v" , err )
74
74
}
75
- if e , a := eventType , action ; e != a {
75
+ if e , a := eType , action ; e != a {
76
76
t .Errorf ("Expected %v, got %v" , e , a )
77
77
}
78
78
if e , a := expect , got ; ! apiequality .Semantic .DeepDerivative (e , a ) {
0 commit comments