From 9ec3efbca2384298a80d760cc923531a1947bf38 Mon Sep 17 00:00:00 2001 From: qvalentin Date: Fri, 17 Jan 2025 20:55:24 +0100 Subject: [PATCH] chore: replace for with range loop --- test/corpus_test.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/corpus_test.go b/test/corpus_test.go index b5a0e4b..31dd50b 100644 --- a/test/corpus_test.go +++ b/test/corpus_test.go @@ -70,13 +70,12 @@ func NewTestCase(file, name, input, sExpression string) TestCase { func getTestCasesForFile(filename string, content string) []TestCase { testCases := []TestCase{} - partsWithEmptyParts := TESTCASE_SEPERATOR.Split(content, -1) parts := []string{} - // remove empty parts - for i := 0; i < len(partsWithEmptyParts); i++ { - if partsWithEmptyParts[i] != "" { - parts = append(parts, partsWithEmptyParts[i]) + // split and remove empty parts + for _, part := range TESTCASE_SEPERATOR.Split(content, -1) { + if part != "" { + parts = append(parts, part) } }