Re:Writing web applications using only the Go Standard Library
by transitorykris on Friday December 23, 2016 @08:12PM
(#13248105)
Go's standard library is excellent. I've found Gorilla Mux to nicely augment net/http and not feel like I'm wrapping magic around idiomatic Go. The only other 3rd party package I routinely use is sqlx.
Re:Writing web applications using only the Go Standard Library
by amenghra on Friday December 23, 2016 @11:42PM
(#13248610)
Give Squalor (https://github.com/square/squalor) a shot.
You might find https://github.com/relops/sqlc really nice from an API design point of view (inspird by jOOQ, a Java sql library).
Sqlc is no longer under development, but you can easily use it as a reference to adapt other libraries to have a similar API.
Re:Writing web applications using only the Go Standard Library
by notheguyouthink on Friday December 23, 2016 @08:36PM
(#13248160)
I literally found out about sqlx a few moments before coming here. I was stringing together ~10 columns by hand, and then when i fed them into the `row.Scan()` method, i just about rage quit. On Monday i'm going to try integrating sqlx and see how i like it.
Any other good sql libs i should know about? My coworkers mostly like sql by hand, so no magic ORMs preferably. But unmarshalling rows seems like an absolute requirement.. this is just anarchy without it.
Re:Writing web applications using only the Go Standard Library
by bitexploder on Friday December 23, 2016 @09:01PM
(#13248224)
Gorm. Give it a try. Light on magic. Can write by hand easily still. If you arent writing really complex queries and are just shuffling records around Gorm makes life a joy. It is no SQL alchemy but for most SQL users ORM/SRM makes life better. Anyway I think most systems using SQL in business logic end up implementing a relational mapper, just not as well as battle tested mappers. But some use cases do justify avoiding such tools.
Re:Writing web applications using only the Go Standard Library
by rhodysurf on Friday December 23, 2016 @08:44PM
(#13248181)
Love mux, its super simple and still lets me use the standard library way of making web apps
Re:Writing web applications using only the Go Standard Library
by ue_ on Friday December 23, 2016 @08:14PM
(#13248107)
I generally dislike the little things that beautify things. I don't like the decorators for routing in Flask, for example.
This is why I like CGI. I can make an effort to understand it.
Re:Writing web applications using only the Go Standard Library
by abglassman on Saturday December 24, 2016 @12:52PM
(#13250804)
Then you are absolutely going to hate the article I recently contributed to Gopher Academy's advent series, https://blog.gopheracademy.com/advent-2016/go-syntax-for-dsl... , about using Go to create terse, declarative DSLs for things like, say, building a webapp.
I've tried a few of the Go web frameworks and it feels like they often add a lot of indirection. It's appropriate for Python or Ruby, but it feels out of place in Go. Yes you might cut out a little repetitious code but DRY doesn't seem to be a key pillar of the Go language