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/asn1: BitString.At wrong doc return type #53287

Closed
bnoordhuis opened this issue Jun 8, 2022 · 1 comment
Closed

encoding/asn1: BitString.At wrong doc return type #53287

bnoordhuis opened this issue Jun 8, 2022 · 1 comment
Labels
Documentation FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@bnoordhuis
Copy link

// At returns the bit at the given index. If the index is out of range it
// returns false.
func (b BitString) At(i int) int {
if i < 0 || i >= b.BitLength {
return 0
}
x := i / 8
y := 7 - uint(i%8)
return int(b.Bytes[x]>>y) & 1
}

The doc comment says it returns false when it returns zero.

(I'd submit a PR but the contributor process is too onerous for a one-liner like this.)

@cherrymui cherrymui added Documentation NeedsFix The path to resolution is known, but the work has not been done. help wanted labels Jun 8, 2022
@cherrymui cherrymui added this to the Backlog milestone Jun 8, 2022
@gopherbot
Copy link

Change https://go.dev/cl/411134 mentions this issue: encoding/asn1: Fixes #53287

@golang golang locked and limited conversation to collaborators Sep 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants