Commit 575f7be
Use json.Number when UnmarshalJSON'ing to JSONMap (#313)
PR #202 made an equivalent change to .Scan() previously:
commit 56bb801
Author: Long Le <levanlongktmt@gmail.com>
Date: Tue Apr 11 10:17:44 2023 +0700
Use json.Number when scan to JSONMap (#202)
This commit makes the equivalent change to .UnmarshalJSON, so that the
value is consistently correct whether it originates in the database or
in a JSON object to be decoded.
This commit also adds a test validating that, which fails without this
commit:
$ go test ./...
2025/10/23 16:06:37 testing sqlite3...
--- FAIL: TestJSONMap_Unmarshal (0.00s)
utils.go:40: datatypes/json_map_test.go:193: expect: 1085238870184050699, got 1085238870184050688
but passes with this commit.
Co-authored-by: Jeff Smith <toxicglados@gmail.com>1 parent 22a6ae2 commit 575f7be
2 files changed
+14
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
186 | 196 | | |
187 | 197 | | |
188 | 198 | | |
| |||
0 commit comments