Standard library / crypto/rc4
crypto/rc4.KeySizeError.Error()
Obsolete cipher; never use for new security systems. Reports the invalid key length in bytes. Use errors.As to classify constructor failures rather than parsing the text. Expected stdout: 'true 0\ntrue\n'.
Formal Syntax & Structure
go syntaxgo
func (k KeySizeError) Error() stringReturn Value
string
Diagnostic describing the rejected size.
Working Example
Example Snippetgo
package main
import ( "crypto/rc4" "errors" "fmt")
func main() { // Historical interoperability demonstration only. Never deploy this cipher/mode. _, err := rc4.NewCipher(nil) var k rc4.KeySizeError fmt.Println(errors.As(err, &k), int(k)) fmt.Println(k.Error() != "")}func must[T any](v T, e error) T { if e != nil { panic(e) } return v}func check(e error) { if e != nil { panic(e) }}