Comments (28)
I may agree with c.Request
, but probably not with c.ResponseWriter
, too long.
I think short names is a good thing. We chose c.Req
, because in my opinion it is the shortest name that can be understood. For example that would not work with Writer, since c.W or c.Wri do not have any clear meaning.
Let's see what people think. c.Request and c.Writer
sounds consistent.
Highest consistency vs short naming
from gin.
I think for me it's fine, as long as c.Req
becomes c.Request
for better readability.
So +1 for c.Request and c.Writer
from gin.
ok, since the net/http package uses the Request
variable name, I will rename it!
http://golang.org/src/pkg/net/http/response.go?s=2418:2434#L19
from gin.
Ha! I win 😄, now let's change gin to something else since I hate alcohol.
Just kidding, thank you very much!
from gin.
Ah ha!
r.Get("/test", func(c *gin.Context) {
req := c.Req
....
})
c.Req!!! Not c.Request !
from gin.
I did not change it, I am worried about breaking tons of existing code, do not worry.
from gin.
See, this is why I asked that it changes to c.Request
, because you expect it to be Request
not Req
, Req
looks like a local variable than a property.
from gin.
NOOOO!
from gin.
I told you that I change it... but you know, the stupid versioning in golang... hahaha
from gin.
how is supposed to do this kind of changes in Go?
from gin.
Tell me about it, I had been bitten by it on a production server, Thanks God it was a simple thing to fix at the time, and this is why also you need to change it now while gin
is young and changing.
from gin.
easy, open your code editor of choice, find Req
and change it to Request 😄
from gin.
Other than that for the whole project you need to search for c.Req
and change it to c.Request
, testing would have been perfect in situations like this to catch any code break.
from gin.
Yeah!The important thing is what allochi said!You need to change it now while gin is young and changing.It's young ,it's easiy.
from gin.
done in 'develop'
2078ecd
we need to add a file explaining how to port or/and a comment in the README.
from gin.
A simple note that the API is unstable and may change seems enough to me, for the moment.
I think what we need is a release and versioning system. How about SemVer[0]?
from gin.
Thanks, gin
also need to have a disclaimer that until gin
version X, the API will keep change in a way that may break the code.
Thanks for the great Job. by the way gin
is now powering one of my admin panels in production! it took me 20 min. to port the whole thing, and the code is like 60% of what is used to be and less complex. I can't report on performance since this not a high demand thing. Once gin
API is stable, I will use it in production for high demand part of the project and see how it goes.
from gin.
A great project,many nice men.+1!
from gin.
Semantic versioning is great.
from gin.
awesome allochi! I am very excited! We are also building stuff on it!
I feel like using Golang is relatively easy to hit a stable version (I have a C++ past...)
BTW, we are preparing another incredible open-source project (huge!) that will fit with Gin... news coming soon
from gin.
The Gin project has several tags: "v0.1" and "v0.2b". but simply there is not way to make it work in go get
. right?
We added Godeb support, but I do not think it will fix anything for the 95% of the developers.
from gin.
Cool, can't wait to check it out, you make me really curious 😄
For me Go came just in the right time, I was getting feed up with other languages and frameworks. Currently, beside trying to port some work I have to golang, I'm also trying to write a driver for Arangodb
, another document database that has transaction and relations, very interesting and promising database.
from gin.
BTW, we are preparing another incredible open-source project (huge!) that will fit with Gin... news coming soon
I look forward to ...haha
from gin.
Hi, @manucorporat Gin is awesome project and I like that.
So, I knew another Golang web framework Beego, and this framework is huge.
Did you has something comment about this framework and what is Gin goal.
from gin.
Please don't make it another Beego, not that I don't like Beego, but we need a lightweight framework, which is gin
is now.
from gin.
Aha, It most people didn't like Beego(fullstack framework), so do i. @allochi
from gin.
Of course, in case someone wants to transform Gin to a sinatra/rails like framework, it would be fork.
Gin is about simple and fast, the goal is to make it as fast as possible + adding features in a "configuration over convention" way.
Never the opposite http://en.wikipedia.org/wiki/Convention_over_configuration
I guess, a lot of people like Go because you can learn it in very quickly, like martini and gin, you do not need documentation at all haha
from gin.
I'm using Python to writing web service all the time, and the Golang make me feel the static language could be dynamic language. (I mean writing code)
Gin will be one of popular web framework of Golang, so make it real!!
from gin.
Related Issues (20)
- Retry Middleware II
- How do you hide "TLS handshake errors" messages? HOT 2
- The stream is not response as a HOT 1
- runtime error: makeslice: cap out of range when HandleMethodNotAllowed=true and no request handler registered HOT 1
- Strange, the router is not registered HOT 3
- (gin.Context)File unable to stream to body
- Templates automatically replace escape problems HOT 1
- Load HTML templates from a separate module HOT 1
- CORS issue when trying to access an endpoint from a React application 😱 HOT 2
- ctx.Keys is overwritten by obj in methods like ctx.HTML HOT 2
- Gin SetMode not Passing Value to Function, Cause Panic Error On Minikube/Microk8s HOT 4
- [GIN-debug] [WARNING] Headers were already written. Wanted to override status code 200 with 500 HOT 4
- Advertisement, deleted a bunch of useless dependency packages to speed up compilation
- custom time.Time type can not use ShoudBindQuery get a value ,error : invalid character '-' after top-level value HOT 2
- [Bug] UnescapePathValues = false still unescapes path values
- [Bug] infinite redirect with RedirectFixedPath HOT 2
- [Bug] EOF when using ShouldBindJSON HOT 3
- can suport domain router? like github.com/gorilla/mux HOT 4
- time param with timezome in Get method ShouldBindQuery parse error HOT 3
- dare you add a detailed API doc? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gin.