{ "html": "
\n

Installation

\n

Simply install raven-go through go get:

\n
$ go get github.com/getsentry/raven-go\n
\n
\n
\n\n\n
\n

Setup

\n

Make sure that you’ve set configured raven with your DSN, typically inside the init()\nin your main package is a good place.

\n
package main\n\nimport "github.com/getsentry/raven-go"\n\nfunc init() {\n    raven.SetDSN("___DSN___")\n}\n
\n
\n

If you don’t call SetDSN, we will attempt to read it from your environment under the\nSENTRY_DSN environment variable.

\n

Next, we need to wrap our http.Handler with our RecoveryHandler:

\n
func root(w http.ResponseWriter, r *http.Request) {\n    // ... do stuff\n}\nhttp.HandleFunc("/", raven.RecoveryHandler(root))\n
\n
\n
\n", "link": null, "id": "go-http", "name": "net/http" }