Standard library / encoding/hex
encoding/hex.InvalidByteError
Error type containing the invalid input byte; use errors.As to inspect it. Expected stdout: 'true 90\n'.
Formal Syntax & Structure
go syntaxgo
type InvalidByteError byteWorking Example
Example Snippetgo
package main
import ( "encoding/hex" "errors" "fmt")
func must(e error) { if e != nil { panic(e) }}
func main() { _, e := hex.DecodeString("ZZ") var bad hex.InvalidByteError fmt.Println(errors.As(e, &bad), byte(bad))}