Commit f198ba3
authored
Fix go enum encoding (#1892)
Adds a test and fixes enums as members of structs
<!-- ELLIPSIS_HIDDEN -->
----
> [!IMPORTANT]
> Fixes Go enum encoding by updating pointer handling in
`generate_types.rs`, `decode.go`, and `types.go`, with a new test case
in `cffi_test.go`.
>
> - **Behavior**:
> - Fixes enum encoding in Go by updating `render_value_coercion` in
`generate_types.rs` to handle pointers correctly.
> - Modifies `decodePrimitiveValue` in `decode.go` to return pointers.
> - Updates `Decode` methods in `types.go` and `unions.go` to use
pointer dereferencing.
> - **Tests**:
> - Adds a test case in `cffi_test.go` for `Person` struct to verify
enum encoding fix.
> - **Misc**:
> - Removes unnecessary type casting in `types.go` and `unions.go`.
>
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup>
for ca36789. You can
[customize](https://app.ellipsis.dev/BoundaryML/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>
<!-- ELLIPSIS_HIDDEN -->1 parent 42b3fbe commit f198ba3
5 files changed
Lines changed: 254 additions & 310 deletions
File tree
- engine
- language_client_codegen/src/go
- language_client_go/pkg
- integ-tests/go
- baml_client/types
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
64 | 63 | | |
65 | | - | |
66 | | - | |
| 64 | + | |
67 | 65 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 66 | + | |
77 | 67 | | |
78 | 68 | | |
79 | 69 | | |
| |||
84 | 74 | | |
85 | 75 | | |
86 | 76 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | 77 | | |
93 | 78 | | |
94 | | - | |
| 79 | + | |
95 | 80 | | |
96 | 81 | | |
97 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
396 | 397 | | |
397 | 398 | | |
398 | 399 | | |
399 | | - | |
400 | | - | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
401 | 403 | | |
402 | 404 | | |
403 | 405 | | |
| |||
0 commit comments