We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
I'm attempting to Unmarshal a data buffer with the contents of a large file (Download), but I get an error inside the json-iterator code:
panic: runtime error: index out of range goroutine 1 [running]: github.com/json-iterator/go.growOne(0xc420094300, 0x5fb680, 0x5134c0, 0x5fb680, 0x535180) /home/paganini/go/src/github.com/json-iterator/go/feature_reflect_slice.go:134 +0x17a github.com/json-iterator/go.(*sliceDecoder).doDecode.func1(0xc420610000, 0x51342c) /home/paganini/go/src/github.com/json-iterator/go/feature_reflect_slice.go:100 +0x68 github.com/json-iterator/go.(*Iterator).ReadArrayCB(0xc420610000, 0xc42004f738, 0x5134c0) /home/paganini/go/src/github.com/json-iterator/go/feature_iter_array.go:39 +0xc3 github.com/json-iterator/go.(*sliceDecoder).doDecode(0xc4200948d0, 0xc420094300, 0xc420610000) /home/paganini/go/src/github.com/json-iterator/go/feature_reflect_slice.go:99 +0xfc github.com/json-iterator/go.(*sliceDecoder).Decode(0xc4200948d0, 0xc420094300, 0xc420610000) /home/paganini/go/src/github.com/json-iterator/go/feature_reflect_slice.go:82 +0x4c github.com/json-iterator/go.(*structFieldDecoder).Decode(0xc420098800, 0xc420094300, 0xc420610000) /home/paganini/go/src/github.com/json-iterator/go/feature_reflect_struct_decoder.go:930 +0x5c github.com/json-iterator/go.(*twoFieldsStructDecoder).Decode(0xc420094ea0, 0xc420094300, 0xc420610000) /home/paganini/go/src/github.com/json-iterator/go/feature_reflect_struct_decoder.go:524 +0x264 github.com/json-iterator/go.(*Iterator).ReadVal(0xc420610000, 0x50e480, 0xc420094300) /home/paganini/go/src/github.com/json-iterator/go/feature_reflect.go:236 +0xd1 github.com/json-iterator/go.(*frozenConfig).Unmarshal(0xc4200a8400, 0xc520266000, 0x9985053d, 0xfffffe00, 0x50e480, 0xc420094300, 0x0, 0x0) /home/paganini/go/src/github.com/json-iterator/go/feature_config.go:319 +0x1ab main.main() /home/paganini/go/src/github.com/marcopaganini/op-desafios/desafio-05/marcopaganini/d05.go:100 +0x1fc
This particular file is parsed by the standard encoding/json library without any problems.
The text was updated successfully, but these errors were encountered:
9fddff0
from your test https://github.com/marcopaganini/op-desafios/blob/master/desafio-05/marcopaganini/d05.go
I find the Salario is of type int, but actual value is float in the json file.
Salario
Sorry, something went wrong.
This is not the problem. You looked at the "master" branch. The correct source is the "dev" branch: https://github.com/marcopaganini/op-desafios/blob/dev/desafio-05/marcopaganini/d05.go
The problem still happens with Salario being a float64.
Incidentally, a colleague poked at this very same problem and got to feature_reflect_slice.go, lines 131/132:
srcPtr := (*[1 << 30]byte)(slice.Data) dstPtr := (*[1 << 30]byte)(dst)
He changed the 30 above in the shift operation to 31 and things seem to pass. Do we have a design limitation in json-iterator?
30
31
the hard coded 30 has been changed in 9fddff0
try to fix json-iterator#194 with larger array
c85d280
No branches or pull requests
I'm attempting to Unmarshal a data buffer with the contents of a large file (Download), but I get an error inside the json-iterator code:
This particular file is parsed by the standard encoding/json library without any problems.
The text was updated successfully, but these errors were encountered: