gin-gonic / gin

Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.
https://gin-gonic.com/
MIT License
79.24k stars 8.03k forks source link

Example using go-asset-builder will be hard to test as presented. #2059

Open rbtcollins opened 5 years ago

rbtcollins commented 5 years ago

The gin single binary template example uses go-asset-builder, but this has a fairly significant bug - https://github.com/jessevdk/go-assets/issues/10 - which means that test code which loads the templates more than once will ahem end up with empty templates. As you can see there I tracked it down eventually with an assert;

Having the example use a different system like packr, or recommending loading the templates into a global variable separate to router instantiation, might be a good way to help others avoid this issue.

TyPh00nCdr commented 3 years ago

Isn't this resolved by 9b9f4fa?