mirror of
https://github.com/golang/go.git
synced 2025-10-19 11:03:18 +00:00
net/url: add panic to unhex for imposible error case
Change-Id: I9f39b3d2a1a0a3e510afc874dd071302b2b0c89e Reviewed-on: https://go-review.googlesource.com/c/go/+/643555 Reviewed-by: Damien Neil <dneil@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
parent
e2f342fc51
commit
e5ae12ab82
1 changed files with 2 additions and 1 deletions
|
@ -67,8 +67,9 @@ func unhex(c byte) byte {
|
|||
return c - 'a' + 10
|
||||
case 'A' <= c && c <= 'F':
|
||||
return c - 'A' + 10
|
||||
default:
|
||||
panic("invalid hex character")
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type encoding int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue