• 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
..
clang-format.sh Loading commit data...
code_generators.cpp Loading commit data...
flatc.cpp Loading commit data...
flatc_main.cpp Loading commit data...
flathash.cpp Loading commit data...
idl_gen_cpp.cpp Loading commit data...
idl_gen_dart.cpp Loading commit data...
idl_gen_fbs.cpp Loading commit data...
idl_gen_general.cpp Loading commit data...
idl_gen_go.cpp Loading commit data...
idl_gen_grpc.cpp Loading commit data...
idl_gen_js_ts.cpp Loading commit data...
idl_gen_json_schema.cpp Loading commit data...
idl_gen_lobster.cpp Loading commit data...
idl_gen_lua.cpp Loading commit data...
idl_gen_php.cpp Loading commit data...
idl_gen_python.cpp Loading commit data...
idl_gen_rust.cpp Loading commit data...
idl_gen_text.cpp Loading commit data...
idl_parser.cpp Loading commit data...
reflection.cpp Loading commit data...
util.cpp Loading commit data...