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.
func CallerInfo() []string {
pc := uintptr(0)
file := ""
line := 0
ok := false
name := ""
var pc uintptr
var ok bool
var file string
var line int
var name string
callers := []string{}
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`)
diff, count = args.Diff([]interface{}{"string", 123, false})
assert.Equal(t, 1, count)
assert.Contains(t, diff, `(int=123) matched by func(int) bool`)
diff, count = args.Diff([]interface{}{"string", 123, true})