Closed GoogleCodeExporter closed 9 years ago
Where do you see it documented that the default default is the first enum value?
If you write
optional Status status [default=OK] = 1;
then you'll get your desired behaviour.
Original comment by dsymo...@golang.org
on 30 Aug 2013 at 3:22
I know explicitly adding the default option will fix the issue, but that's not
the point. When the default is not explicitly defined, c++ / java / python all
implements the same behavior (i.e. use the first defined values as default). I
know a lot of the c++ code within google (for instance, most of ads enums)
depends on this assumption. Using go instead of sawzall on logs will fail in
that case ...
Original comment by patr...@dropbox.com
on 30 Aug 2013 at 3:35
I'm not saying it's wrong. I'm asking where it's documented, if anywhere.
Matching other implementations is probably fine.
Original comment by dsymo...@golang.org
on 30 Aug 2013 at 4:13
Note that we should probably change the getter, but it can still behave weirdly
in other regards.
Original comment by dsymo...@golang.org
on 30 Aug 2013 at 4:20
https://developers.google.com/protocol-buffers/docs/proto#optional
Original comment by patr...@dropbox.com
on 3 Sep 2013 at 7:48
Original comment by dsymo...@golang.org
on 3 Sep 2013 at 8:35
This issue was closed by revision 6f1bebb865e8.
Original comment by dsymo...@golang.org
on 18 Sep 2013 at 1:42
Original issue reported on code.google.com by
patr...@dropbox.com
on 30 Aug 2013 at 3:16