[client] pqkem: mention *ErrorMsg in the Decode doc comment

Decode also returns *ErrorMsg for MsgError; list it so callers handling the
marker are not misled.

Found in cubic review on #7098 (client/internal/pqkem/message.go:95).
This commit is contained in:
riccardom
2026-10-09 09:50:09 +02:00
parent 6e0c150fc9
commit 85eaf4319d
+1 -1
View File
@@ -92,7 +92,7 @@ func (m *ErrorMsg) Encode() []byte {
return frame(MsgError, m.ExchangeID, nil)
}
// Decode parses a framed message into one of *OfferMsg / *AnswerMsg.
// Decode parses a framed message into one of *OfferMsg / *AnswerMsg / *ErrorMsg.
func Decode(buf []byte) (MsgType, any, error) {
if len(buf) < headerSize {
return 0, nil, fmt.Errorf("message too short: %d bytes", len(buf))