• David Reiss's avatar
    [Go] Make enums into real types, add String() (#5235) · 718ddea5
    David Reiss authored
    * [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
    718ddea5
Name
Last commit
Last update
..
NamespaceA Loading commit data...
NamespaceC Loading commit data...
namespace_test1.fbs Loading commit data...
namespace_test1_generated.h Loading commit data...
namespace_test1_generated.js Loading commit data...
namespace_test1_generated.lobster Loading commit data...
namespace_test1_generated.rs Loading commit data...
namespace_test1_generated.ts Loading commit data...
namespace_test1_namespace_a.namespace_b_generated.dart Loading commit data...
namespace_test2.fbs Loading commit data...
namespace_test2_generated.h Loading commit data...
namespace_test2_generated.js Loading commit data...
namespace_test2_generated.lobster Loading commit data...
namespace_test2_generated.rs Loading commit data...
namespace_test2_generated.ts Loading commit data...
namespace_test2_namespace_a_generated.dart Loading commit data...
namespace_test2_namespace_c_generated.dart Loading commit data...