These are chat archives for gin-gonic/gin

25th
Nov 2015
Alexey Palazhchenko
@AlekSi
Nov 25 2015 11:17
Hello everyone. My company evaluated several web frameworks and decided to use gin. Now we are looking for the areas to contribute, and looks like documentation requires some love. So we are going to send pull requests.
Why special check for key = 0?
Jamie Stackhouse
@itsjamie
Nov 25 2015 12:27
I would hazard it is a special case to allow quick access to the request via the net/context API.
Alexey Palazhchenko
@AlekSi
Nov 25 2015 12:27
But who needs it?
Jamie Stackhouse
@itsjamie
Nov 25 2015 12:29
Well, its most likely a trick to allow better performance. I'm not sure who uses it. I honestly haven't see many people using Gin with net/context. Hopefully that'll change to help interop
Sorry I can't help.
Oleg Lebedev
@olebedev
Nov 25 2015 13:09
@AlekSi net/context already plugged in other good framework, you may use it if needed net/context
Alexey Palazhchenko
@AlekSi
Nov 25 2015 13:09
I don’t; I merely trying to understand motivation and improve documentation
Jamie Stackhouse
@itsjamie
Nov 25 2015 14:31
Like I mentioned, it is definitely there to minimize the cost of access the http.Request from the gin context. Not sure what prompted adding it, probably the only person who could tell you is the author, I'd probably git blame it, check and see if they have an e-mail and I'd recommend directly asking them if the goal is correct documentation.
Alexey Palazhchenko
@AlekSi
Nov 25 2015 14:32
http.Request can be accessed directly: https://github.com/gin-gonic/gin/blob/master/context.go#L38