Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Azazel
Jun 6, 2001
I bitch slap for a living - you want some?
Been using Go professionally for over a year now. Love it.

Here's a fancy Riak database driver I wrote: https://github.com/riaken/riaken-core

Adbot
ADBOT LOVES YOU

Azazel
Jun 6, 2001
I bitch slap for a living - you want some?

Copland posted:

What kind of projects do you use it for? I love the philosophy of Go, but what has always kept me from putting the effort into learning it was thinking that I wouldn't get much mileage out of it in my day-to-day life.

Just so you know where I'm coming from, I use Ruby a lot to automate workplace tasks. Most of the code I write is imperative, but I do take advantage of the methods that come with the standard classes.

Standard boring work stuff has been along the lines of RESTful microservice APIs using net/http, gorilla/mux, etc. No more wasting time with web frameworks, configuring web servers, unicorns, or rainbows. I've tinkered with realtime game servers communicating over TCP and/or my cgo ENet wrapper (buggy!) quite a bit recently. The standard library is so small and easy to remember, I'm more inclined to write one off scripts in Go than a scripting language these days.

Azazel
Jun 6, 2001
I bitch slap for a living - you want some?

Copland posted:

I just hope that I don't run into too many frustrations with it on the Mac.

I develop exclusively on Mac, cross-compiling my linux server builds with zero problems. You'll be fine.

Save yourself some trouble when you setup your environment by reading this: https://code.google.com/p/go-wiki/wiki/GOPATH

Azazel
Jun 6, 2001
I bitch slap for a living - you want some?

etatoby posted:

One note though: I've seen a lot of libraries using empty structs (or their pointers: &Foo{}) as a Go type literal, like Foo.class in Java. The problem with it is that it allocates and zeroes an entire struct of that type for nothing. That could be large, if it contains fixed arrays or other embedded structs.

Unfortunately Go does not have a clean type literal that can be passed around, but there is a cheap alternative in the form of a typed nil pointer:

pre:
(*Foo)(nil)

It only takes two words of memory (as interface values do, IIRC) and it's not too verbose. Users of your library may even define their own nil pointers as global vars, to be used as type literals, and that's even easier to write: var FooType *Foo

There is a reason people use empty structs, they are zero sized.

Azazel
Jun 6, 2001
I bitch slap for a living - you want some?

Bozart posted:

That isn't what he's talking about though. The rel.Relation interface has methods which take an example tuple into an interface{} so that it can reflect on it to determine how to construct result tuples. He's saying I should have callers construct a nil pointer of the appropriate type instead to avoid the overhead.

Not trying to nitpick too hard here, it's clear he was talking about your library. However, "I've seen a lot of libraries using empty structs" is a very general statement, which is the part I was addressing. Feel free to ignore my comment if it does not apply.

Azazel
Jun 6, 2001
I bitch slap for a living - you want some?

QPZIL posted:

What's the current frontrunner for web frameworks? I've heard good things about Revel.

I use a combination of the standard net/http and gorilla/mux libraries myself, but hear good things about https://github.com/zenazn/goji if you are looking for something minimal.

Also, this has been floating around twitter today: http://arslan.io/ten-useful-techniques-in-go - Good advice in there.

Azazel
Jun 6, 2001
I bitch slap for a living - you want some?
Gustavo Niemeyer, creator of the esteemed mgo mongodb library, and doing a lot of awesome work with a QML library, has created this service for making sane go-gettable packages: http://labix.org/gopkg.in

It doesn't fix the "some rear end in a top hat deletes his repository" problem, but it does make for a fairly solid way of getting consistent packages versions as long as the library maintainer does proper tagging.

Azazel
Jun 6, 2001
I bitch slap for a living - you want some?

NickPlowswell posted:

I don't really see how using go get doesn't satisfy people. If I recall correctly one of Go's goals is to make everything backwards compatible and it is adapted by pretty much all major packages.

I'm actually really glad that there aren't such ridiculous things like the depreciation mechanics Java has that are so blatantly ignored by most of it's users.

When you start importing a handful of 3rd party libraries and share those libraries among multiple developers/projects "go get" alone becomes very unsatisfying.

Adbot
ADBOT LOVES YOU

Azazel
Jun 6, 2001
I bitch slap for a living - you want some?

Brecht posted:

Forking the repos you depend on is called vendoring, and it works fine. Great, even.

http://github.com/tools/godep

Vendoring is what the core Go devs at Google recommend (and is what they do internally). I do it myself, definitely the best solution given what we have.

For the record here is a list of various solutions: https://code.google.com/p/go-wiki/wiki/PackageManagementTools

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply