Skip to content
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

encoding/json: internal cleanup of return values for encodeState.stringBytes and encodeState.string #11883

Closed
imjasonh opened this issue Jul 27, 2015 · 1 comment

Comments

@imjasonh
Copy link

In encode.go, type encodeState has two methods, stringBytes and string, each of which return (int, error). In both cases, the only error that is returned from the methods is nil, and the int that is returned is never read:

  • _, err := e.stringBytes(...) on lines 449, 465
  • e.string(...) on lines 544, 546, 580, 615

Return values are similarly ignored in encode_test.go:

  • _, err := e.string(...) on line 384
  • _, err := e.stringBytes(...) on line 390

I believe these methods can simply return nothing without any change in functionality.

@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Jul 27, 2015
@gopherbot
Copy link

CL https://golang.org/cl/15836 mentions this issue.

@golang golang locked and limited conversation to collaborators Oct 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants