Re: Things which may be of interest in Go v1.4

2014-12-12 Thread Gustavo Niemeyer
On Thu Dec 11 2014 at 7:04:50 PM Katherine Cox-Buday < katherine.cox-bu...@canonical.com> wrote: > Good point Gustavo; generating code was all doable before Go v1.4, go > generate just bakes it into the development process. > > Can either of you go into some detail as to why you don't like code >

Re: Things which may be of interest in Go v1.4

2014-12-11 Thread roger peppe
I like this command: code.google.com/p/go.tools/cmd/stringer BTW, we're already using the internal package convention for the charm store, and it seems to work well (apart from the ever present temptation to import the internal packages from outside!) On 11 December 2014 at 21:04, Katherine Cox-B

Re: Things which may be of interest in Go v1.4

2014-12-11 Thread Katherine Cox-Buday
Good point Gustavo; generating code was all doable before Go v1.4, go generate just bakes it into the development process. Can either of you go into some detail as to why you don't like code generation? To start off, a thought experiment: if I were to generate a new Set type for my Foo struct, ho

Re: Things which may be of interest in Go v1.4

2014-12-11 Thread Tim Penhey
I also couldn't help but read through the release notes of Go 1.4 last night. I agree with Gustavo that we should avoid code generation unless absolutely necessary. I have a strong feeling that it won't be necessary given how far we have come without it. I did like the internal packages, however

Re: Things which may be of interest in Go v1.4

2014-12-11 Thread Gustavo Niemeyer
Thanks for the write up Katherine, and I agree these are all very nice improvements. On this list, the one I find slightly less exciting is "go generate". This is essentially a standard way to run external processing tools, which might already be done before anyway via standard practices. For exam

Re: Things which may be of interest in Go v1.4

2014-12-11 Thread Katherine Cox-Buday
On Thu, Dec 11, 2014 at 10:52 AM, Eric Snow wrote: > > Cool. So generics via macros? > Well, I intentionally didn't specify generics. Yes, that is a use-case. But from what I gather, go generate is intended to be used once when first writing code, not every time you compile. So it's more like a

Re: Things which may be of interest in Go v1.4

2014-12-11 Thread Eric Snow
Thanks for writing this up, Katherine! On Thu, Dec 11, 2014 at 9:21 AM, Katherine Cox-Buday wrote: > go generate > https://golang.org/doc/go1.4#gogenerate > This is *very* powerful and could reduce the number of copy/paste snippets, > or unsafe reflection code we have to write. For those of you w

Things which may be of interest in Go v1.4

2014-12-11 Thread Katherine Cox-Buday
Hey All, I just got done reading through the Go v1.4 release-notes[1], and these are some high-level thoughts about what pieces may be of interest to Juju development. This is certainly not comprehensive, but I thought you all might be interested. Happy release day :) - *go generate *https://g