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
to fix #7709 and #7067, #9706
add Decorder.Buffer([]byte) function, it like bufio.Buffer(buf []byte, max int) benefits:
type InplaceReader int func (p *InplaceReader) Read([]byte) (int, error) { if *p == 0 { return 0, io.EOF } ret := int(*p) *p = 0 return ret, io.EOF } ...... n, remoteAddr, err := socket.ReadFromUDP(bs) if err != nil { return err } r := InplaceReader(len(bs)) decoder := json.NewDecoder(&r) decoder.UseNumber() // json.Unmarshal() is unsupport UseNumber decoder.Buffer(bs) decoder.Decode(&x)
The text was updated successfully, but these errors were encountered:
It looks like all of those issues were closed as Working As Intended. It is preferable to keep all of the context for an issue and a proposed fix within the context of a single issue, rather than creating a new one.
Sorry, something went wrong.
No branches or pull requests
to fix #7709 and #7067, #9706
add Decorder.Buffer([]byte) function, it like bufio.Buffer(buf []byte, max int)
benefits:
The text was updated successfully, but these errors were encountered: