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

Projects
None yet
3 participants
@ImJasonH
Copy link

commented Jul 27, 2015

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

This comment has been minimized.

Copy link

commented Oct 14, 2015

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

@bradfitz bradfitz closed this in 0731471 Oct 14, 2015

@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.
You can’t perform that action at this time.