Skip to content

Commit 9afb5cf

Browse files
author
Tobi Fuhrimann
committed
Fix linting issues
1 parent 3c4d62a commit 9afb5cf

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

is.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,7 @@ func areEqual(a, b interface{}) bool {
253253
}
254254
aValue := reflect.ValueOf(a)
255255
bValue := reflect.ValueOf(b)
256-
if aValue == bValue {
257-
return true
258-
}
259-
return false
256+
return aValue == bValue
260257
}
261258

262259
func callerinfo() (path string, line int, ok bool) {
@@ -318,7 +315,7 @@ func loadArguments(path string, line int) (string, bool) {
318315
text = text[braceI+1:]
319316
cs := bufio.NewScanner(strings.NewReader(text))
320317
cs.Split(bufio.ScanBytes)
321-
i := 0
318+
j := 0
322319
c := 1
323320
for cs.Scan() {
324321
switch cs.Text() {
@@ -330,9 +327,9 @@ func loadArguments(path string, line int) (string, bool) {
330327
if c == 0 {
331328
break
332329
}
333-
i++
330+
j++
334331
}
335-
text = text[:i]
332+
text = text[:j]
336333
return text, true
337334
}
338335
i++

is_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,8 @@ func TestLoadArguments(t *testing.T) {
271271
// TestSubtests ensures subtests work as expected.
272272
// https://github.com/matryer/is/issues/1
273273
func TestSubtests(t *testing.T) {
274-
is := New(t)
275274
t.Run("sub1", func(t *testing.T) {
276-
is := is.New(t)
275+
is := New(t)
277276
is.Equal(1+1, 2)
278277
})
279278
}

0 commit comments

Comments
 (0)