Commit 75b7e1a
fix(proto): encode nil *uint8 as "0" like other numeric pointers (#3869)
WriteArg encodes a nil pointer to a numeric type as its zero value: every
nil *int*/*uint*/*float*/*bool returns "0". The *uint8 case instead returned
an empty string, which is also inconsistent with its own non-nil path that
writes the number via w.uint. Encode nil *uint8 as "0" and update the table
test assertion.
Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>1 parent d551638 commit 75b7e1a
2 files changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
0 commit comments