/usr/share/gocode/src/github.com/bugsnag/bugsnag-go/examples/http/main.go is in golang-github-bugsnag-bugsnag-go-dev 1.0.5+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | package main
import (
"github.com/bugsnag/bugsnag-go"
"log"
"net/http"
)
func main() {
http.HandleFunc("/", Get)
bugsnag.Configure(bugsnag.Configuration{
APIKey: "066f5ad3590596f9aa8d601ea89af845",
})
log.Println("Serving on 9001")
http.ListenAndServe(":9001", bugsnag.Handler(nil))
}
func Get(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(200)
w.Write([]byte("OK\n"))
var a struct{}
crash(a)
}
func crash(a interface{}) string {
return a.(string)
}
|