mirror of
https://github.com/golang/go
synced 2024-11-22 03:04:41 -07:00
runtime: fix Caller
log: add test of Caller New regexp in log test is picky and will require some maintenance, but it catches off-by-one mistakes too. Fixes #710. R=gri CC=esko.luontola, golang-dev https://golang.org/cl/887043
This commit is contained in:
parent
a267ff6a81
commit
6d69fd1fe3
@ -17,7 +17,7 @@ const (
|
||||
Rdate = `[0-9][0-9][0-9][0-9]/[0-9][0-9]/[0-9][0-9]`
|
||||
Rtime = `[0-9][0-9]:[0-9][0-9]:[0-9][0-9]`
|
||||
Rmicroseconds = `\.[0-9][0-9][0-9][0-9][0-9][0-9]`
|
||||
Rline = `[0-9]+:`
|
||||
Rline = `(58|60):` // must update if the calls to l.Logf / l.Log below move
|
||||
Rlongfile = `.*/[A-Za-z0-9_\-]+\.go:` + Rline
|
||||
Rshortfile = `[A-Za-z0-9_\-]+\.go:` + Rline
|
||||
)
|
||||
|
@ -479,7 +479,7 @@ void
|
||||
{
|
||||
Func *f;
|
||||
|
||||
if(callers(skip, &retpc, 1) == 0 || (f = findfunc(retpc-1)) == nil) {
|
||||
if(callers(1+skip, &retpc, 1) == 0 || (f = findfunc(retpc-1)) == nil) {
|
||||
retfile = emptystring;
|
||||
retline = 0;
|
||||
retbool = false;
|
||||
|
Loading…
Reference in New Issue
Block a user