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:
alirezaarzehgar 2025-01-21 00:24:28 +03:30 committed by Gopher Robot
parent e2f342fc51
commit e5ae12ab82

View file

@ -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