|
|
Subscribe / Log in / New account

Federated blogging with WriteFreely

Federated blogging with WriteFreely

Posted Mar 16, 2019 10:32 UTC (Sat) by ms (subscriber, #41272)
Parent article: Federated blogging with WriteFreely

Re building and "downloading several dozen packages". The project is at least using go.mod and so the downloads are fully pinned to git commits/tags and checksummed. So it's not quite the wild west of "let's just download the latest version of foo and hope for the best". Personally, I much prefer pointers to vendoring all your deps, but I know opinions differ on that.

They're using the built-in Go webserver which as far as I know has an excellent security record - I would have no worries about exposing it directly to the internet; I have used it a lot commercially/professionally.

The template language *is* documented. It's the standard Go templating system. https://golang.org/pkg/text/template/ https://golang.org/pkg/html/template/
That said, I agree about documenting which resources/methods/vars are available to the templates. The template entry point is Execute or ExecuteTemplate, and the last arg to that is always the "receiver" for the template, but eg https://github.com/writeas/writefreely/blob/cb1bd37f64abc... is unhelpful given it comes in as the empty interface. Generally I consider use of the empty interface in Go as a code smell... https://github.com/writeas/writefreely/blob/32e99d00415c6... is somewhat more discoverable. OTOH, depends on the intended audience - I've been working professionally in Go for over 5 years now so I have no qualms digging through this.

Just FTR, I've no association with WriteFreely and have never heard of it or looked at the code base before this morning.


to post comments

Downloading packages

Posted Mar 16, 2019 13:56 UTC (Sat) by corbet (editor, #1) [Link] (3 responses)

From my reading, it's using a bunch of "go get" commands, with no version pinning in sight anywhere. Are those version strings hidden somewhere that I'm unaware of?

Downloading packages

Posted Mar 16, 2019 14:12 UTC (Sat) by ms (subscriber, #41272) [Link] (2 responses)

"go get" inspects the go.mod and go.sum files in the root of the project.

https://github.com/writeas/writefreely/blob/master/go.mod
https://github.com/writeas/writefreely/blob/master/go.sum

There's been an awful lot of thinking that has gone into this mechanism, and whilst it's not quite finished in Go 1.12, it's pretty close these days. There's a lot of writing about it all at https://research.swtch.com/vgo

Downloading packages

Posted Mar 16, 2019 14:23 UTC (Sat) by corbet (editor, #1) [Link] (1 responses)

OK, clearly I'm pretty ignorant about how Go packaging works, and it's not as bad as I had feared. Thanks for enlightening me.

Downloading packages

Posted Mar 16, 2019 14:25 UTC (Sat) by ms (subscriber, #41272) [Link]

No problem. Glad I could help!


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds