Merge pull request #8359 from nlowe/bugfix/logging-line-call-outside-repo-root

Fix logger line() call if built outside of the repo root
This commit is contained in:
Steven Zou 2019-08-05 14:49:06 +08:00 committed by GitHub
commit 97c812a1e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -278,7 +278,7 @@ func line(callDepth int) string {
line = 0
}
l := strings.SplitN(file, srcSeparator, 2)
if len(l) > 0 {
if len(l) > 1 {
file = l[1]
}
return fmt.Sprintf("[%s:%d]:", file, line)