paulgorman.org

< ^ txt

Sat Nov 14 06:00:02 EST 2020 ======================================== Slept from midnight to seven without waking. Sunny in the morning then becoming partly cloudy. Highs in the mid 40s. South winds up to 10 mph shifting to the southeast late in the afternoon. To do ---------------------------------------- - Order groceries Done. Delivery 3–5 PM. - D&D this evening? No, we didn't get a quorum. Started watching Atlanta on Hulu. Pretty fun. Good characters. Darius is great. An unusual format for drama. They get a surprising amount of story out of twenty-minute episodes. Why does the order of templates matter in Go's template.ParseFiles? https://golang.org/pkg/text/template/#ParseFiles > ParseFiles creates a new Template and parses the template definitions from the named files. The returned template's name will have the base name and parsed contents of the first file. https://stackoverflow.com/questions/57339682/golang-template-order > Instead you should use Template.ExecuteTemplate() and explicitly specify you want to execute > err := tmpl.ExecuteTemplate(w, "analytics", data) > That way it will not matter in what order you pass the templates to template.ParseFiles(). > And a friendly note: do not parse your templates in the handler: it's slow. Parse them once, on app startup, store them e.g. in package variables, and just execute them in the handler. Chatted with Jay and Ed on Signal for a while in the afternoon. Worked a little on some Go stuff. Hmph, I apparently forgot to order bananas. Talked to Ed on Jitsi for a while. Servings: grains 7/6, fruit 1/4, vegetables 1/4, dairy 2/2, meat 1/3, nuts 0/0.5 Brunch: macaroni with Brussels sprouts, cookies, coffee Dinner: orange, cheese curls

< ^ txt