Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Migrating from Go to Rust. Parent comment
func Login(req LoginRequest, cookies Cookies, db *sql.DB) (LoginResponse, error) { ... } router.HandleFunc("POST /signup", fw.Wrap(Login))
It also serializes/deserializes responses and handles both JSON and templates.
db is just a singleton-lifetime dependency, we often also have ctx, http.Request, http.Response, Cookie, which are request-time lifetimes.
I thought about open-sourcing it but most Golang developers seem to hate it with a passion, so I just gave up, haha.
There are no comments on this comment yet.
It also serializes/deserializes responses and handles both JSON and templates.
db is just a singleton-lifetime dependency, we often also have ctx, http.Request, http.Response, Cookie, which are request-time lifetimes.
I thought about open-sourcing it but most Golang developers seem to hate it with a passion, so I just gave up, haha.