Update dependencies

Closes #2129
This commit is contained in:
Alexander Neumann 2019-01-27 21:07:57 +01:00
parent aa7043151a
commit b9f0f031b6
672 changed files with 116946 additions and 13086 deletions

View file

@ -12,9 +12,12 @@ import (
"net/http"
"net/url"
"os"
"path/filepath"
"runtime"
)
func Main() {
MainPath = filepath.Dir(findMainPath())
installHealthChecker(http.DefaultServeMux)
port := "8080"
@ -31,6 +34,24 @@ func Main() {
}
}
// Find the path to package main by looking at the root Caller.
func findMainPath() string {
pc := make([]uintptr, 100)
n := runtime.Callers(2, pc)
frames := runtime.CallersFrames(pc[:n])
for {
frame, more := frames.Next()
// Tests won't have package main, instead they have testing.tRunner
if frame.Function == "main.main" || frame.Function == "testing.tRunner" {
return frame.File
}
if !more {
break
}
}
return ""
}
func installHealthChecker(mux *http.ServeMux) {
// If no health check handler has been installed by this point, add a trivial one.
const healthPath = "/_ah/health"