diff options
| author | Christine Dodrill <me@christine.website> | 2019-03-27 07:40:42 -0700 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2019-03-27 07:43:48 -0700 |
| commit | bce017f56f2413872a3a904067d6d19d173a9904 (patch) | |
| tree | 7b1f1515d7e8297de14f8a2ebdfa8f4f3ae332df /cmd | |
| parent | 7e6a1cbd5841b094a7e168f8500075443f31e8e0 (diff) | |
| download | xesite-bce017f56f2413872a3a904067d6d19d173a9904.tar.xz xesite-bce017f56f2413872a3a904067d6d19d173a9904.zip | |
shadow errors
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/site/main.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/cmd/site/main.go b/cmd/site/main.go index 3719095..e3987b3 100644 --- a/cmd/site/main.go +++ b/cmd/site/main.go @@ -30,11 +30,15 @@ func main() { port = "29384" } + ctx := ln.WithF(opname.With(context.Background(), "main"), ln.F{ + "port": port, + }) + prometheus.Register(prommod.NewCollector("christine")) s, err := Build() if err != nil { - ln.FatalErr(context.Background(), err, ln.Action("Build")) + ln.FatalErr(ctx, err, ln.Action("Build")) } mux := http.NewServeMux() @@ -43,8 +47,8 @@ func main() { }) mux.Handle("/", s) - ln.Log(context.Background(), ln.F{"action": "http_listening", "port": port}) - http.ListenAndServe(":"+port, mux) + ln.Log(ctx, ln.Action("http_listening")) + ln.FatalErr(ctx, http.ListenAndServe(":"+port, mux)) } // Site is the parent object for https://christine.website's backend. @@ -56,7 +60,6 @@ type Site struct { jsonFeed *jsonfeed.Feed mux *http.ServeMux - sitemap []byte xffmw *xff.XFF } @@ -189,7 +192,7 @@ func Build() (*Site, error) { }) s.mux.Handle("/sitemap.xml", middleware.Metrics("sitemap", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/xml") - smi.WriteTo(w) + _, _ = smi.WriteTo(w) }))) return s, nil |
