Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
wherever possible (#5716)
* go: replace objAPI-generated Pack func with method
See discussion at https://github.com/google/flatbuffers/issues/5668
* go: replace generated union type UnPack func with method
Similar to discussion https://github.com/google/flatbuffers/issues/5668
But signature:
```
func AnyUnPack(t Any, table flatbuffers.Table) *AnyT
```
Becomes,
```
func (rcv Any) UnPack(table flatbuffers.Table) *AnyT
```
|
|
|
|
* start
* works for current usages!
* unpack: vector of struct
* optimize byte slice
* support nested struct
* support null table
* support struct
* support union
* update generated code
* grumble
* fix compiler warning
* update generated code
* wrap type in namespace
* bug
* wrap in namespace
* enum byte arrays
* generate struct for unions
* basic testing
* remove branching
* fix assert
* pack vector of fixed structs correctly
* omit null vectors
* Refactor Union Pack and UnPack methods
Remove append usage to increase code efficiency when dealing with large vectors
* generate goldens
|
|
Fixes #5357 (regression introduced by #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
|
|
- update C++ monster_test::Color to unsigned type
- update Go Color:ubyte in the go_test.go
- add workaround for unsigned enum in java test
- sync generate.bat and generate.sh
|
|
|
|
As recommended by https://golang.org/pkg/cmd/go/internal/generate/:
To convey to humans and machine tools that code is generated,
generated source should have a line early in the file that
matches the following regular expression (in Go syntax):
^// Code generated .* DO NOT EDIT\.$
|
|
Similar to what protobufs does with its `Message` interface, introduce here such interface and create a generic `GetRootAs` method to deserialize a flatbuffer.
|
|
Enums are not fixed because depending on they have comments or not they
will be aligned alogn the asssignment character.
|
|
Emit GetRootAs methods for all types in Go and Python
|
|
|
|
|
|
|
|
When creating a CreateXxx(...) method for a simple table type,
enum-type fields with a non-zero default must have an explicit
cast for the respective argument default value, because in C#,
there is an implicit cast from int to an enum only for 0.
Also, added an example of such type into the example monster_test
type, so that we test this feature.
|