Giter VIP home page Giter VIP logo

Comments (28)

manucorporat avatar manucorporat commented on April 20, 2024

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.

allochi avatar allochi commented on April 20, 2024

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.

manucorporat avatar manucorporat commented on April 20, 2024

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.

allochi avatar allochi commented on April 20, 2024

Ha! I win πŸ˜„, now let's change gin to something else since I hate alcohol.

Just kidding, thank you very much!

from gin.

muei avatar muei commented on April 20, 2024

Ah ha!
r.Get("/test", func(c *gin.Context) {
req := c.Req
....
})
c.Req!!! Not c.Request !

from gin.

manucorporat avatar manucorporat commented on April 20, 2024

I did not change it, I am worried about breaking tons of existing code, do not worry.

from gin.

allochi avatar allochi commented on April 20, 2024

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.

allochi avatar allochi commented on April 20, 2024

NOOOO!

from gin.

manucorporat avatar manucorporat commented on April 20, 2024

I told you that I change it... but you know, the stupid versioning in golang... hahaha

from gin.

manucorporat avatar manucorporat commented on April 20, 2024

how is supposed to do this kind of changes in Go?

from gin.

allochi avatar allochi commented on April 20, 2024

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.

allochi avatar allochi commented on April 20, 2024

easy, open your code editor of choice, find Req and change it to Request πŸ˜„

from gin.

allochi avatar allochi commented on April 20, 2024

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.

muei avatar muei commented on April 20, 2024

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.

manucorporat avatar manucorporat commented on April 20, 2024

done in 'develop'
2078ecd

we need to add a file explaining how to port or/and a comment in the README.

from gin.

pinscript avatar pinscript commented on April 20, 2024

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]?

[0] http://semver.org/

from gin.

allochi avatar allochi commented on April 20, 2024

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.

muei avatar muei commented on April 20, 2024

A great project,many nice men.+1!

from gin.

allochi avatar allochi commented on April 20, 2024

Semantic versioning is great.

from gin.

manucorporat avatar manucorporat commented on April 20, 2024

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.

manucorporat avatar manucorporat commented on April 20, 2024

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.

allochi avatar allochi commented on April 20, 2024

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.

muei avatar muei commented on April 20, 2024

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.

johndeng avatar johndeng commented on April 20, 2024

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.

allochi avatar allochi commented on April 20, 2024

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.

johndeng avatar johndeng commented on April 20, 2024

Aha, It most people didn't like Beego(fullstack framework), so do i. @allochi

from gin.

manucorporat avatar manucorporat commented on April 20, 2024

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.

johndeng avatar johndeng commented on April 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.