Prevent errors test fail if $GOPATH is something like /home/user/caddy (#2347)

This commit is contained in:
linquize 2018-11-18 05:51:08 +08:00 committed by Toby Allen
parent 1b085efa47
commit 8f7a1d6a25

View File

@ -142,7 +142,7 @@ func (h ErrorHandler) recovery(w http.ResponseWriter, r *http.Request) {
}
// Trim file path
delim := "/caddy/"
delim := "/github.com/mholt/caddy/"
pkgPathPos := strings.Index(file, delim)
if pkgPathPos > -1 && len(file) > pkgPathPos+len(delim) {
file = file[pkgPathPos+len(delim):]