From b65ab889ab7f4eb69a75de5f774faf386aaf8380 Mon Sep 17 00:00:00 2001 From: Iskander Sharipov Date: Tue, 5 Feb 2019 13:29:29 +0300 Subject: [PATCH] net/rpc: fix args order in strings.Contains call MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 TryBot-Result: Gobot Gobot Reviewed-by: Daniel Martí --- src/net/rpc/client_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/rpc/client_test.go b/src/net/rpc/client_test.go index d116d2acc9..03225e3d01 100644 --- a/src/net/rpc/client_test.go +++ b/src/net/rpc/client_test.go @@ -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) } }() -- 2.50.0