The Go package, [google.golang.org/appengine](https://godoc.org/google.golang.org/appengine), provides [IsDevAppServer](https://godoc.org/google.golang.org/appengine#IsDevAppServer) which reports whether an App Engine app is running in the development App Server (e.g. `localhost:8080`). However, this does not work unless the ([deprecated](https://cloud.google.com/appengine/docs/standard/go111/go-differences)) standalone SDK is used. See [appengine.go#L57](https://github.com/golang/appengine/blob/16bce7d3dc4e458f2f6f56a1349cbbfcdc8a8fdf/appengine.go#L57) for the implementation.

New GAE apps written in Go are basically a regular web server that can be compiled and started locally like any go program;

* **old;** `dev_appserver.py`
* **new;** `go run main.go`

Detecting a development server can be useful for to prevent CORS issues when running locally:

```golang
func setDevHeaders(w http.ResponseWriter) {
    w.Header().Set("Access-Control-Allow-Origin", "http://localhost:4200")
    w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
    w.Header().Set("Access-Control-Request-Method", "POST, GET")
    w.Header().Set("Access-Control-Expose-Headers", "Content-Disposition")
}

```

When needed I can then branch:

```golang
if appengine.IsDevAppServer() {
    setDevHeaders(w)
}

```

What is the recommended way to achieve this in a standalone Go server running on App Engine?