Commit b65ab889 authored by Iskander Sharipov's avatar Iskander Sharipov Committed by Daniel Martí

net/rpc: fix args order in strings.Contains call

The old code looks suspicious and is fragile.
It would fail if error messages were not totally the same.
Swapped the arguments order to fix that.

Change-Id: Id5df7242fb9224d0090245286ef8986ebb15e921
Reviewed-on: https://go-review.googlesource.com/c/161157
Run-TryBot: Iskander Sharipov <quasilyte@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarDaniel Martí <mvdan@mvdan.cc>
parent 856525ce
......@@ -57,7 +57,7 @@ func TestGobError(t *testing.T) {
if err == nil {
t.Fatal("no error")
}
if !strings.Contains("reading body EOF", err.(error).Error()) {
if !strings.Contains(err.(error).Error(), "reading body EOF") {
t.Fatal("expected `reading body EOF', got", err)
}
}()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment