{ "html": "
Simply install raven-go
through go get
:
$ go get github.com/getsentry/raven-go\n
Make sure that you’ve set configured raven
with your DSN, typically inside the init()
\nin your main
package is a good place.
package main\n\nimport "github.com/getsentry/raven-go"\n\nfunc init() {\n raven.SetDSN("___DSN___")\n}\n
If you don’t call SetDSN
, we will attempt to read it from your environment under the\nSENTRY_DSN
environment variable.
Next, we need to wrap our http.Handler
with our RecoveryHandler
:
func root(w http.ResponseWriter, r *http.Request) {\n // ... do stuff\n}\nhttp.HandleFunc("/", raven.RecoveryHandler(root))\n