many lint fixes and optimizations (#17)
* util/kubernetes: drop stale files * debug/log/kubernetes: drop stale files * util/scope: remove stale files * util/mdns: drop stale files * lint fixes Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit was merged in pull request #17.
	This commit is contained in:
		
							
								
								
									
										34
									
								
								codec/noop_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								codec/noop_test.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | ||||
| package codec | ||||
|  | ||||
| import ( | ||||
| 	"bytes" | ||||
| 	"testing" | ||||
| ) | ||||
|  | ||||
| func TestNoopBytes(t *testing.T) { | ||||
| 	req := []byte("test req") | ||||
| 	rsp := make([]byte, len(req)) | ||||
|  | ||||
| 	nc := NewCodec() | ||||
| 	if err := nc.Unmarshal(req, &rsp); err != nil { | ||||
| 		t.Fatal(err) | ||||
| 	} | ||||
|  | ||||
| 	if !bytes.Equal(req, rsp) { | ||||
| 		t.Fatalf("req not eq rsp: %s != %s", req, rsp) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func TestNoopString(t *testing.T) { | ||||
| 	req := []byte("test req") | ||||
| 	var rsp string | ||||
|  | ||||
| 	nc := NewCodec() | ||||
| 	if err := nc.Unmarshal(req, &rsp); err != nil { | ||||
| 		t.Fatal(err) | ||||
| 	} | ||||
|  | ||||
| 	if !bytes.Equal(req, []byte(rsp)) { | ||||
| 		t.Fatalf("req not eq rsp: %s != %s", req, rsp) | ||||
| 	} | ||||
| } | ||||
		Reference in New Issue
	
	Block a user