-
-
Notifications
You must be signed in to change notification settings - Fork 531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x = [] decodes into nil #338
Comments
It's not really an intentional change, as far as I can recall. It's really the encoding/json behaviour that's problematic; it's a long-standing issue. I'll probably fix it eventually, but it might be a while. I'll review and merge PRs though. |
dtcaciuc
added a commit
to dtcaciuc/toml
that referenced
this issue
Jan 12, 2022
This restores v0.3 behaviour and also makes it consistent with how the same decodes into something like struct { S []string }. Closes BurntSushi#338
arp242
pushed a commit
that referenced
this issue
Jan 12, 2022
This restores v0.3 behaviour and also makes it consistent with how the same decodes into something like struct { S []string }. Closes #338
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following program works differently between 0.3.1 and 0.4.1:
On 0.3.1,
On 0.4.1,
For my use case, this is a problem because I'm subsequently encoding the value into JSON and it writes
x = null
instead of the expectedx = []
. It also goes deeper than that, for instancex = [[]]
would get JSONed asx = [null]
.Is this an intended change? Do you think it would be possible/correct to restore the previous behaviour?
The text was updated successfully, but these errors were encountered: