pkg/plugins/client.go: don't try to encode os decode if it's nil

When user call the `Call()` method, they don't always want to sent
some args or get the return value, so they use `nil` when call `Call()`
method and this will casue an error. It's better to not trying to
encode or decode if it's nil.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
This commit is contained in:
Lei Jitang 2015-12-05 02:55:50 -05:00
parent 92079d14e1
commit a1a4101b73
2 changed files with 13 additions and 5 deletions

View file

@ -63,6 +63,10 @@ func TestEchoInputOutput(t *testing.T) {
if !reflect.DeepEqual(output, m) {
t.Fatalf("Expected %v, was %v\n", m, output)
}
err = c.Call("Test.Echo", nil, nil)
if err != nil {
t.Fatal(err)
}
}
func TestBackoff(t *testing.T) {