1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-23 04:47:02 +00:00

fix travis fail on deprecation example test

Former-commit-id: 3f6bb0f01702ab2c2cd7f348b29ec142af036cb3
This commit is contained in:
Gerasimos (Makis) Maropoulos
2019-06-21 23:17:27 +03:00
parent d0104defa8
commit 1f9ead426e
3 changed files with 26 additions and 18 deletions

View File

@@ -21,13 +21,21 @@ func getCaller() (string, int) {
for {
frame, more := frames.Next()
file := frame.File
if (!strings.Contains(frame.File, "github.com/kataras/iris") ||
strings.Contains(frame.File, "github.com/kataras/iris/_examples") ||
strings.Contains(frame.File, "github.com/iris-contrib/examples") ||
(strings.Contains(frame.File, "github.com/kataras/iris/core/router") && !strings.Contains(frame.File, "deprecated.go"))) &&
!strings.HasSuffix(frame.Func.Name(), ".getCaller") && !strings.Contains(frame.File, "/go/src/testing") {
return frame.File, frame.Line
splitAfterPart := "/src/"
if (!strings.Contains(file, "github.com/kataras/iris") ||
strings.Contains(file, "github.com/kataras/iris/_examples") ||
strings.Contains(file, "github.com/iris-contrib/examples") ||
(strings.Contains(file, "github.com/kataras/iris/core/router") && !strings.Contains(file, "deprecated.go"))) &&
!strings.HasSuffix(frame.Func.Name(), ".getCaller") && !strings.Contains(file, "/go/src/testing") {
// remove the $GOPATH.
n := strings.Index(file, splitAfterPart)
if n != -1 {
file = file[n+len(splitAfterPart):]
}
return file, frame.Line
}
if !more {