mirror of
https://github.com/kataras/iris.git
synced 2025-12-23 12:57:05 +00:00
Updated all dependencies one by one to go.mod - Backup and remove the vendor folder entirely and update most of the examples - next commit will contain the rest of the updated
Former-commit-id: 2791c50256c0f00d6e08a408e5cb009262c49588
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
@@ -18,23 +20,21 @@ func getCaller() (string, int) {
|
||||
var pcs [32]uintptr
|
||||
n := runtime.Callers(1, pcs[:])
|
||||
frames := runtime.CallersFrames(pcs[:n])
|
||||
|
||||
wd, _ := os.Getwd()
|
||||
for {
|
||||
frame, more := frames.Next()
|
||||
file := frame.File
|
||||
|
||||
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"))) &&
|
||||
if (!strings.Contains(file, "/kataras/iris") ||
|
||||
strings.Contains(file, "/kataras/iris/_examples") ||
|
||||
strings.Contains(file, "/iris-contrib/examples") ||
|
||||
(strings.Contains(file, "/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):]
|
||||
if relFile, err := filepath.Rel(wd, file); err == nil {
|
||||
file = "./" + relFile
|
||||
}
|
||||
|
||||
return file, frame.Line
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ func ExampleParty_StaticWeb() {
|
||||
|
||||
fmt.Print(err)
|
||||
// Output: StaticWeb is DEPRECATED and it will be removed eventually.
|
||||
// Source: github.com/kataras/iris/core/router/deprecated_example_test.go:9
|
||||
// Source: ./deprecated_example_test.go:9
|
||||
// Use .HandleDir("/static", "./assets") instead.
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ func ExampleParty_StaticHandler() {
|
||||
|
||||
fmt.Print(err)
|
||||
// Output: StaticHandler is DEPRECATED and it will be removed eventually.
|
||||
// Source: github.com/kataras/iris/core/router/deprecated_example_test.go:24
|
||||
// Source: ./deprecated_example_test.go:24
|
||||
// Use iris.FileServer("./assets", iris.DirOptions{ShowList: false, Gzip: true}) instead.
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ func ExampleParty_StaticEmbedded() {
|
||||
fmt.Print(err)
|
||||
// Output: StaticEmbedded is DEPRECATED and it will be removed eventually.
|
||||
// It is also miss the AssetInfo bindata function, which is required now.
|
||||
// Source: github.com/kataras/iris/core/router/deprecated_example_test.go:39
|
||||
// Source: ./deprecated_example_test.go:39
|
||||
// Use .HandleDir("/static", "./assets", iris.DirOptions{Asset: Asset, AssetInfo: AssetInfo, AssetNames: AssetNames}) instead.
|
||||
}
|
||||
|
||||
@@ -62,6 +62,6 @@ func ExampleParty_StaticEmbeddedGzip() {
|
||||
fmt.Print(err)
|
||||
// Output: StaticEmbeddedGzip is DEPRECATED and it will be removed eventually.
|
||||
// It is also miss the AssetInfo bindata function, which is required now.
|
||||
// Source: github.com/kataras/iris/core/router/deprecated_example_test.go:55
|
||||
// Source: ./deprecated_example_test.go:55
|
||||
// Use .HandleDir("/static", "./assets", iris.DirOptions{Gzip: true, Asset: Asset, AssetInfo: AssetInfo, AssetNames: AssetNames}) instead.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user