From cdeb66b82d11d51b82791b3e4c720f9f01cc6abb Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 16:16:44 +0100 Subject: [PATCH] ax(node): rename pe to protocolError in GetProtocolErrorCode AX Principle 1: pe is an abbreviation requiring a comment to explain. Renamed to protocolError throughout, including the usage example comment. Co-Authored-By: Charon --- pkg/node/protocol.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/node/protocol.go b/pkg/node/protocol.go index 93428f9..92adce6 100644 --- a/pkg/node/protocol.go +++ b/pkg/node/protocol.go @@ -4,7 +4,7 @@ import ( "strconv" ) -// if pe, ok := err.(*ProtocolError); ok { log(pe.Code, pe.Message) } +// if protocolError, ok := err.(*ProtocolError); ok { log(protocolError.Code, protocolError.Message) } type ProtocolError struct { Code int Message string @@ -79,8 +79,8 @@ func IsProtocolError(err error) bool { // code := GetProtocolErrorCode(err) // 0 when err is not a ProtocolError func GetProtocolErrorCode(err error) int { - if pe, ok := err.(*ProtocolError); ok { - return pe.Code + if protocolError, ok := err.(*ProtocolError); ok { + return protocolError.Code } return 0 }