Hacker News new | past | comments | ask | show | jobs | submit login

I find the args approach the most appealing to me. Yeah you lose some compile time safety. Like you said the other option is a global context with mutexes which still somewhat misses some compile time safety. It basically boils down to reflection over type assertions.

I think Martini handles this pretty darn well if I do say so myself ;)




I think you get the best of both worlds with `gocraft/web`. I feel args when you inject 3 or more (db, session ...) is cumbersome. `gocraft/web` is faster too since it has less reflection.


Agreed. I really like how gocraft does contexts. Very cool way to structure your app




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: