Repository navigation
Commit 3b1d281
structdiff: diff json:"-," fields like encoding/json does (#7207)
`GetStructDiff` skipped every field whose JSON name is `-`, including
`json:"-,"` / `json:"-,omitempty"` fields that encoding/json serializes
under the key `"-"`. It now skips only the exact tag `json:"-"` via
`structaccess.IsSkippedField`, which `IsEqual`, `structaccess` and
`structwalk` already use. Before this change `IsEqual` could report two
values as different while `GetStructDiff` returned no changes.
The change is reported at path `-`, the same form `structwalk` emits and
`structaccess.Get` resolves.
No type in this repo or in databricks-sdk-go uses such a tag (only test
fixtures do), so this is a consistency fix with no user-visible effect
today.
This pull request and its description were written by Isaac.
Co-authored-by: Isaac <no-reply@databricks.com>1 parent 251d760 commit 3b1d281
2 files changed
Lines changed: 30 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
222 | 227 | | |
223 | 228 | | |
224 | 229 | | |
225 | 230 | | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | 231 | | |
230 | 232 | | |
231 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
1034 | 1036 | | |
1035 | 1037 | | |
1036 | 1038 | | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
0 commit comments