>>11022Fiber is good for getting things up and going fast, but I agree with your criticisms. I don't hate it, but I wouldn't use it for anything serious that I would start today; I have one project in it which works, but I occasionally found myself beating my head against the wall because of Fiber.
net/http is barebones but you can build your functionality on it at least and only include what you need. My most major project in it uses regular expressions to determine which route to take, but it also has only three routes anyway.
>using custom functions inside of templates with html/templateYou can define functions in Go and use them quite easily; allow your template to use them by tossing them into
(*Template).Funcs, functions that have a return type of
template.HTML will not be HTML escaped but all others will.
Inside of templates is a bit weirder and as such I don't really bother with it, but essentially
{{define "template name"}}do stuff with {{.}}{{end}} and call with
{{template "template name"}} or if you want to set dot,
{{template "template name" <dot value>}}.
However, by the time I'm doing that, I'm hitting the absolute limits of html/template anyway so I just write the same thing in Go, where it would be faster regardless of the templating engine, except quicktemplate which is a different beast altogether.
>performanceDon't worry about super fast performance until you're getting those numbers of requests per second, in which case you're likely getting hit with an attack anyway.
I would assume that most would not notice the few hundred microseconds on a
slightly faster engine either.
>I figure it's time to get rid of posts_*You should keep them to reduce query complexity, but I would move the files JSON into the database. Unless it already is, in which case I now wonder why you would toss JSON into the database in the first place, but I digress.
My imageboard projects never made it outside of my machine (save one but it's a textboard), but I had no qualms with a {posts,files,replies}_
board table; don't take this from me however, as I am by no means an expert on anything I do, nor is everything I do right and best.