News for hackers. Stuff that matters.
Re:Build Your Own Web Framework in Go by melling on Friday November 14, 2014 @09:10AM (#8607155)
I created a small starter Go Web Server from a website that I'm building:

GitHub: https://github.com/melling/GoWebServer

I'm not sure that I like embedding html in fmt.Print() methods, along with templates. A lot of my page handlers look something like this:

https://github.com/melling/GoWebServer/blob/master/src/webse...

My site is about 4000-5000 lines of Go, with a bit of "repeating myself". I'd like to hear from devs who've built larger sites.

Btw, here's my site:

http://thespanishsite.com

And the usually "hidden" admin pages where I've done most of my work:

http://thespanishsite.com/admin/summary?language=chinese&pic...

Re:Build Your Own Web Framework in Go by blueblank on Friday November 14, 2014 @09:38AM (#8607293)
Just looking at your fmt.Print link, you could be wrapping everything requiring a template in functions handling the html/template stuff, i.e. have code specifically interfacing templating for you that you can just pass a command "render this template". I had a lot of problems with working through templating and ended up with my own wrappers around html/template in Djinn(https://github.com/thrisp/djinn).