From d11f1336f089d1c675a5e9b22453ebeafc400d2b Mon Sep 17 00:00:00 2001 From: Marty Schoch Date: Fri, 15 May 2015 15:14:15 -0400 Subject: [PATCH] fix issues identified by errcheck --- index_race_test.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/index_race_test.go b/index_race_test.go index 6cf4107f..9bba717e 100644 --- a/index_race_test.go +++ b/index_race_test.go @@ -7,7 +7,8 @@ // either express or implied. See the License for the specific language governing permissions // and limitations under the License. -// this file includes tests which intentionally create race conditions +// this file includes tests which intentionally create race conditions, +// so exclude them from running with the race detector // +build !race @@ -37,11 +38,14 @@ func TestBatchCrashBug195(t *testing.T) { b := index.NewBatch() for i := 0; i < 200; i++ { - b.Index(fmt.Sprintf("%d", i), struct { + err := b.Index(fmt.Sprintf("%d", i), struct { Value string }{ Value: fmt.Sprintf("%d", i), }) + if err != nil { + t.Fatal(err) + } } var wg sync.WaitGroup @@ -56,11 +60,14 @@ func TestBatchCrashBug195(t *testing.T) { // now keep adding to the batch after we've started to execute it for i := 200; i < 400; i++ { - b.Index(fmt.Sprintf("%d", i), struct { + err := b.Index(fmt.Sprintf("%d", i), struct { Value string }{ Value: fmt.Sprintf("%d", i), }) + if err != nil { + t.Fatal(err) + } } wg.Wait()