Which web framework is recommended to use with GO?

2,492 views
Skip to first unread message

Subhajit Datta

unread,
Jan 17, 2015, 6:00:07 AM1/17/15
to golan...@googlegroups.com
Hi,
As of now, there seems to be many web frameworks in GO found on GITHUB projects.
eg:
webgo, gorrila, martini, Goji, Negorini, Revel, Beego
It will be really helpful if the community can suggest the good frameworks from these.
I am a newbie to GO.
Also please provide the pros and cons for the framework/s that you have used.

Thanks and Regards,
Subhajit Datta

Stanislav Paskalev

unread,
Jan 17, 2015, 7:40:57 AM1/17/15
to golan...@googlegroups.com
You can start with the net/http and html/template packages from the standard library.

Regards,
Stanislav

Egon

unread,
Jan 17, 2015, 8:30:07 AM1/17/15
to golan...@googlegroups.com
It depends what you want to accomplish... so if you want any specific recommendation, say what you are trying to build first.

For a general overview, take a look at https://vimeo.com/115940590, he gives a pretty good overview of things.

To a beginner I would recommend starting with net/http and html/template.

+ Egon

Subhajit Datta

unread,
Jan 17, 2015, 9:04:42 AM1/17/15
to Egon, golan...@googlegroups.com

Well I am looking at building a rest API system with Json output.
Looking to use MVC pattern.
Authentication to the API calls, unit testing at model, controller level.
Packing the app with the webserver.
So with the above requirements which framework will be the best.
For testing a dependency injection framework would be ideal.


Thanks and Regards,
Subhajit Datta

--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/R_lqsTTBh6I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Egon

unread,
Jan 17, 2015, 9:13:51 AM1/17/15
to golan...@googlegroups.com, egon...@gmail.com
On Saturday, 17 January 2015 16:04:42 UTC+2, Subhajit Datta wrote: 

Well I am looking at building a rest API system with Json output

That still could be any application :D

What is the thing that the end-user finds useful in the program - that is what you are building... the JSON/REST/JSON etc. are not that important for the end-user.

Looking to use MVC pattern.

Patterns solve a concrete problem, are you sure you have a problem in the first place?

Authentication to the API calls, unit testing at model, controller level.

Separate models to their named package (e.g. https://github.com/egonelbre/event/tree/master/example/guestlist).
 

Packing the app with the webserver.
So with the above requirements which framework will be the best.

negroni + render (github.com/unrolled/render) + some authentication middleware

For testing a dependency injection framework would be ideal.

Not necessary; implement your services/databases/repositories as interfaces and then you can simply mock/stub/fake the interface as needed.


+ Egon

Egon

unread,
Jan 17, 2015, 9:21:54 AM1/17/15
to golan...@googlegroups.com, egon...@gmail.com


On Saturday, 17 January 2015 16:13:51 UTC+2, Egon wrote:
On Saturday, 17 January 2015 16:04:42 UTC+2, Subhajit Datta wrote: 

Well I am looking at building a rest API system with Json output

That still could be any application :D

What is the thing that the end-user finds useful in the program - that is what you are building... the JSON/REST/JSON etc. are not that important for the end-user.

Looking to use MVC pattern.

Patterns solve a concrete problem, are you sure you have a problem in the first place?

Authentication to the API calls, unit testing at model, controller level.

Separate models to their named package (e.g. https://github.com/egonelbre/event/tree/master/example/guestlist).

Just to clarify - package per aggregate root (and if needed support values in separate package(s)).

Kostarev Ilya

unread,
Jan 17, 2015, 12:06:58 PM1/17/15
to golan...@googlegroups.com

On 17 Jan 2015 at 16:30:10, Egon (egon...@gmail.com) wrote:

To a beginner I would recommend starting with net/http and html/template.

In my experience most beginners(at least my fellow commercial web developers) start with Revel, found it not RoR even no Sinatra but faster. Only after that they investigate net/http, discover golang.org/x/net and finally write there own frameworks.
-- 
Kostarev Ilya

On 17 Jan 2015 at 16:30:10, Egon (egon...@gmail.com) wrote:

Subhajit Datta

unread,
Jan 17, 2015, 12:48:17 PM1/17/15
to Egon, golan...@googlegroups.com

Is there an equivalent go tool like maven in java world for dependency management?
I will not be able to discuss the business problem.
From a technology point of view, I am implementing RESTful APIs.
It will grow into a fairly big production system.
So from tech point of view, I am evaluating go or java to implement it.
So the typical requirements are:
Web framework with MVC pattern,
JSON response,
Mysql db connection,
Mongodb connection
Redis/Memcache connection,
Solr/elastic search connection,
Some machine learning,
Logging and log file processing,
Easy packaging and deployment in production environment,
Dependency management,
Code structuring for maintainability.

So can the above be achieved in golang?
If yes, which are the best tools for each?

Thanks and Regards,
Subhajit Datta

Egon

unread,
Jan 17, 2015, 1:05:37 PM1/17/15
to golan...@googlegroups.com, egon...@gmail.com

On Saturday, 17 January 2015 19:48:17 UTC+2, Subhajit Datta wrote:

Is there an equivalent go tool like maven in java world for dependency management?


 

I will not be able to discuss the business problem.
From a technology point of view, I am implementing RESTful APIs.
It will grow into a fairly big production system.
So from tech point of view, I am evaluating go or java to implement it.
So the typical requirements are:
Web framework with MVC pattern,
JSON response,

At the moment I would either use React or vanilla js, depending on the complexity.
 

Mysql db connection,


Mongodb connection

 

Redis/Memcache connection ......

There are a lot of packages, for those I'm not sure what's the best solution:


Logging 


Easy packaging and deployment in production environment,

scp

Dependency management,

godep
 

Code structuring for maintainability.

I would say it's better than Java. Of course this also means doing some things differently than in Java.
 

So can the above be achieved in golang?

Yes.

Of course, the rarer the problem you are solving the less likely you are to find an appropriate library and may need to write your own.

Subhajit Datta

unread,
Jan 18, 2015, 9:42:12 AM1/18/15
to golan...@googlegroups.com
Hi,
So I have figured out that instead of going for a framework, the following is the best course of action to take for building a web app in go:

Can someone please point me to a composition implementation of the above libraries?
A simple hello world, fetching data from db with oAuth, unit tests will be really helpful.

Robert Melton

unread,
Jan 18, 2015, 10:19:24 AM1/18/15
to Subhajit Datta, golang-nuts
Subhajit--

Before you go crazy on the dependencies, take the time to watch Black Mizerany's talk, "Three Fallacies of Dependencies".  http://youtu.be/yi5A3cK1LNA

Additionally, Go and Java have exceptionally different community / cultural values.  Go trends toward simplicity and doing useful work at each step... less ivory tower, more code that is working by close of business.  If you want to try Go, I highly recommend you don't try to pull in multiple things at once, but start with the standard library and do the simplest thing you can get away with -- rinse and repeat.

Start with net/http, html/template, encoding/json ... don't bring in superfluous things like gin until you find a pain point and feel a need to work around it.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Robert Melton | http://robertmelton.com

wkharold

unread,
Jan 19, 2015, 11:16:33 AM1/19/15
to golan...@googlegroups.com, subhaji...@jabong.com
You would do well to heed the wisdom Robert Melton imparted.

kor...@gmail.com

unread,
Mar 25, 2015, 6:49:19 PM3/25/15
to golan...@googlegroups.com
This might be useful. Its a little library I wrote to chain http handlers with the golang context package (https://godoc.org/golang.org/x/net/context).
https://github.com/korbjt/relay

ranav...@gmail.com

unread,
Jun 20, 2015, 8:13:12 PM6/20/15
to golan...@googlegroups.com
You can have look at github.com/labstack/echo - Minimalistic web framework with fastest HTTP router.

Devashish Ghosh

unread,
Sep 28, 2016, 1:46:59 AM9/28/16
to golang-nuts
https://github.com/jabong/florest-core A lightweight workflow based REST API framework with features customized workflow, logging, monitoring, a/b test, dynamic config, profiling, swagger, database adapters, cache adapter.


On Saturday, January 17, 2015 at 4:30:07 PM UTC+5:30, Subhajit Datta wrote:

Jyotiswarup Raiturkar

unread,
Sep 28, 2016, 8:25:56 AM9/28/16
to golang-nuts
i've used https://github.com/gin-gonic/gin/ for a minimalistic framework, gets you started in no time. ( needs an MR for go v 1.6+, not sure if it was merged yet)
At the other end of the spectrum in revel : https://revel.github.io/ which is very much like RoR

Simon Ritchie

unread,
Sep 29, 2016, 6:34:53 AM9/29/16
to golang-nuts, egon...@gmail.com
> I am looking at building a rest API system ... Looking to use MVC pattern.

I have implemented a very simple database-driven website built using MVC.  It has a single table and RESTful requests implementing the CRUD operations on the table.  The design supports the use of interfaces and Inversion of Control.  It's a demonstration piece, and a work in progress.  However, it solves some of the issues that you are looking at, so it may be useful.

I've shown it my own local Go User group and I've reworked it in the light of their comments.  I would appreciate any other comments.

https://github.com/goblimey/films

Reply all
Reply to author
Forward
0 new messages