Skip to content

Commit

Permalink
Fix race condition in printing of diff values.
Browse files Browse the repository at this point in the history
  • Loading branch information
dokterbob committed Jul 14, 2022
1 parent 181cea6 commit 9ebebef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mock/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -880,15 +880,15 @@ func (args Arguments) Diff(objects []interface{}) (string, int) {
actualFmt = "(Missing)"
} else {
actual = objects[i]
actualFmt = fmt.Sprintf("(%[1]T=%[1]v)", actual)
actualFmt = fmt.Sprintf("(%[1]T=%[1]p)", actual)
}

if len(args) <= i {
expected = "(Missing)"
expectedFmt = "(Missing)"
} else {
expected = args[i]
expectedFmt = fmt.Sprintf("(%[1]T=%[1]v)", expected)
expectedFmt = fmt.Sprintf("(%[1]T=%[1]p)", expected)
}

if matcher, ok := expected.(argumentMatcher); ok {
Expand Down

0 comments on commit 9ebebef

Please sign in to comment.