From 444ef756d4f18778c4b3dea9f78c3d878f60933f Mon Sep 17 00:00:00 2001 From: oleiade Date: Fri, 14 Apr 2023 11:26:52 +0200 Subject: [PATCH] Remove the Error's unused `code` field --- webcrypto/errors.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/webcrypto/errors.go b/webcrypto/errors.go index 15844f6..5fb859f 100644 --- a/webcrypto/errors.go +++ b/webcrypto/errors.go @@ -44,9 +44,6 @@ const ( // Error represents a custom error emitted by the // Web Crypto API. type Error struct { - // Code is one of the legacy error code constants, or 0 if none match. - Code int `json:"code"` - // Name contains one of the strings associated with an error name. Name string `json:"name"` @@ -60,9 +57,8 @@ func (e *Error) Error() string { } // NewError returns a new WebCryptoError with the given name and message. -func NewError(code int, name, message string) *Error { +func NewError(name, message string) *Error { return &Error{ - Code: code, Name: name, Message: message, }