From c5d499e514146c66d403b1a5809628b7bf655b8e Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 19 Jul 2019 23:52:52 +0200 Subject: [PATCH] Simplify go code Just reads a bit nicer, in my opinion. --- assert/assertions_test.go | 2 +- http/test_response_writer.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assert/assertions_test.go b/assert/assertions_test.go index 29f89da..7f30070 100644 --- a/assert/assertions_test.go +++ b/assert/assertions_test.go @@ -2205,7 +2205,7 @@ func TestEventuallyTrue(t *testing.T) { state := 0 condition := func() bool { defer func() { - state = state + 1 + state += 1 }() return state == 2 } diff --git a/http/test_response_writer.go b/http/test_response_writer.go index 5c3f813..300a63b 100644 --- a/http/test_response_writer.go +++ b/http/test_response_writer.go @@ -36,7 +36,7 @@ func (rw *TestResponseWriter) Write(bytes []byte) (int, error) { } // add these bytes to the output string - rw.Output = rw.Output + string(bytes) + rw.Output += string(bytes) // return normal values return 0, nil