package.MyType() (eg. http://golang.org/pkg/os/exec/#Command), the mix of
which I find annoying because:
1) The .New() syntax doesn't make it obvious what type to return.
2) The .New() syntax requires a lot of heavy refactoring if you change the
api to add a new type (ie. New has to change to NewBlah())
3) Mixing it up with package.Blah() just confuses matters.
4) It seems terribly inconsistent to have 3 different 'standard' ways of
I thought package.NewBlah() was the approved solution, but now I keep
stumbling into people doing it differently.
What's the go-centric way of doing this, and where is it documented?
(I saw http://golang.org/doc/effective_go.html#composite_literals, but it
isn't explicit there about naming)
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 email@example.com.
For more options, visit https://groups.google.com/groups/opt_out.