David Reiss
718ddea558
[Go] Make enums into real types, add String() ( #5235 )
...
* [Go] Make enums into real types, add String()
This changes the generated code for enums: instead of type aliases,
they're now distinct types, allowing for better type-checking. Some
client code may have to be changed to add casts.
Enum types now have a String() method, so they implement fmt.Stringer.
An EnumValues map is now generated, in addition to the existing
EnumNames map, to easily map strings to values.
Generated enum files are now gofmt-clean.
Fixes #5207
* use example.ColorGreen explicitly
* use valid enum value in mutation test, add new test for "invalid" enum
* add length check and comment
2019-05-17 12:41:39 -07:00
..
2015-05-12 15:40:29 -07:00
2017-05-16 14:28:34 -07:00
2018-10-03 11:19:40 -07:00
2019-02-21 19:50:13 +01:00
2018-07-05 15:55:57 -07:00
2017-03-29 09:51:12 -07:00
2017-03-29 09:51:12 -07:00
2017-05-16 14:28:34 -07:00
2019-05-17 12:41:39 -07:00
2018-11-02 11:40:21 -07:00
2018-07-05 15:55:57 -07:00
2019-02-04 23:33:57 +01:00
2016-06-20 11:47:04 -07:00
2018-11-01 12:51:25 -07:00
2019-05-17 12:41:39 -07:00
2018-11-02 11:40:21 -07:00
2018-11-01 12:51:25 -07:00
2019-02-04 23:33:57 +01:00
2018-11-01 12:51:25 -07:00
2018-11-01 12:51:25 -07:00
2019-05-17 12:41:39 -07:00
2018-11-02 11:40:21 -07:00
2018-11-01 12:51:25 -07:00
2019-02-04 23:33:57 +01:00
2018-11-01 12:51:25 -07:00
2019-05-09 10:07:38 -07:00
2019-05-17 12:41:39 -07:00
2018-11-02 11:40:21 -07:00
2018-07-05 15:55:57 -07:00
2019-02-04 23:33:57 +01:00
2016-05-26 15:26:58 +02:00
2019-05-09 10:07:38 -07:00
2019-05-17 12:41:39 -07:00
2019-05-09 10:07:38 -07:00
2019-05-09 10:07:38 -07:00
2019-05-09 10:07:38 -07:00
2019-05-09 10:07:38 -07:00
2018-11-29 10:33:17 -08:00
2019-04-24 12:34:42 -07:00
2018-03-05 16:37:04 -08:00
2018-10-03 11:19:40 -07:00
2019-02-25 23:45:29 +01:00
2018-07-05 15:55:57 -07:00
2018-03-05 15:47:16 -08:00
2018-03-05 15:47:16 -08:00
2018-08-23 10:05:31 -07:00
2018-10-03 11:19:40 -07:00
2019-02-25 23:45:29 +01:00
2018-07-05 15:55:57 -07:00
2016-05-26 15:26:58 +02:00
2018-05-10 10:34:20 -07:00
2017-05-16 14:28:34 -07:00
2018-10-03 11:19:40 -07:00
2019-02-21 19:50:13 +01:00
2018-07-05 15:55:57 -07:00
2016-05-26 15:26:58 +02:00
2016-05-26 15:26:58 +02:00
2019-05-09 10:07:38 -07:00
2019-05-17 12:41:39 -07:00
2019-05-09 10:07:38 -07:00
2019-05-09 10:07:38 -07:00
2019-05-09 10:07:38 -07:00
2019-05-09 10:07:38 -07:00
2018-08-23 10:05:31 -07:00
2019-03-05 21:16:26 -08:00
2019-02-25 23:45:29 +01:00
2018-07-05 15:55:57 -07:00
2018-12-20 16:10:20 -08:00
2017-08-02 08:07:43 -07:00
2019-05-09 10:07:38 -07:00
2019-05-17 12:41:39 -07:00
2019-05-09 10:07:38 -07:00
2019-05-09 10:07:38 -07:00
2019-05-09 10:07:38 -07:00
2019-05-09 10:07:38 -07:00