Handle ineffectual assignments

Removed ineffectual assignments.
pull/910/head
Christian Muehlhaeuser 2019-07-19 23:48:38 +02:00 committed by Boyan Soubachov
parent 1c7f4ef084
commit 02b2656991
2 changed files with 6 additions and 5 deletions

View File

@ -104,11 +104,11 @@ the problem actually occurred in calling code.*/
// failed. // failed.
func CallerInfo() []string { func CallerInfo() []string {
pc := uintptr(0) var pc uintptr
file := "" var ok bool
line := 0 var file string
ok := false var line int
name := "" var name string
callers := []string{} callers := []string{}
for i := 0; ; i++ { for i := 0; ; i++ {

View File

@ -1325,6 +1325,7 @@ func Test_Arguments_Diff_WithArgMatcher(t *testing.T) {
assert.Contains(t, diff, `(bool=false) not matched by func(int) bool`) assert.Contains(t, diff, `(bool=false) not matched by func(int) bool`)
diff, count = args.Diff([]interface{}{"string", 123, false}) diff, count = args.Diff([]interface{}{"string", 123, false})
assert.Equal(t, 1, count)
assert.Contains(t, diff, `(int=123) matched by func(int) bool`) assert.Contains(t, diff, `(int=123) matched by func(int) bool`)
diff, count = args.Diff([]interface{}{"string", 123, true}) diff, count = args.Diff([]interface{}{"string", 123, true})