Skip to content

Commit

Permalink
Merge pull request #7 from fulldump/fulldump-patch-1
Browse files Browse the repository at this point in the history
Update asserts.go
  • Loading branch information
fulldump authored Jul 13, 2021
2 parents 4e2297a + 928d7a3 commit 61f9353
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions asserts.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,16 @@ func printShould(value interface{}) (arg0, arg1 string) {

frames := runtime.CallersFrames(p[0].Stack())

frames.Next()
frames.Next()
frames.Next()
frame, _ := frames.Next()
// Make it compatible with latests golang versions (1.14 on)
frame, more := frames.Next()
for ; more; frame, more = frames.Next() {
if frame.Function == "github.com/fulldump/biff.printShould" {
break
}
}

frame, _ = frames.Next()
frame, _ = frames.Next()

l := readFileLine(frame.File, frame.Line)

Expand Down

0 comments on commit 61f9353

Please sign in to comment.