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/hex: clarify supported cases #64132

Closed
3052 opened this issue Nov 14, 2023 · 1 comment
Closed

encoding/hex: clarify supported cases #64132

3052 opened this issue Nov 14, 2023 · 1 comment
Labels
Documentation NeedsFix The path to resolution is known, but the work has not been done.

Comments

@3052
Copy link

3052 commented Nov 14, 2023

for these:

https://godocs.io/encoding/hex#DecodeString
https://godocs.io/encoding/hex#NewDecoder
https://godocs.io/encoding/hex#Decode

upper and lower input are accepted, but the current docs make no mention of that fact. I see an example with lower case:

https://godocs.io/encoding/hex#example-Decode

but no examples with upper case. so one might assume upper case is not supported, when it is:

package main

import "encoding/hex"

func main() {
   b, err := hex.DecodeString("2A")
   if err != nil {
      panic(err)
   }
   println(b[0] == '*')
}
@3052 3052 added the Proposal label Nov 14, 2023
@seankhliao seankhliao added Documentation NeedsFix The path to resolution is known, but the work has not been done. and removed Proposal labels Nov 14, 2023
@gopherbot
Copy link

Change https://go.dev/cl/543836 mentions this issue: encoding/hex: change the example code to make it clearer

@3052 3052 closed this as completed Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation 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