ax(node): replace prose comment with usage example on ParseResponse
AX Principle 2 — comments show HOW with real values, not what the signature already says. The previous comment restated the method name as prose; replaced with a concrete call pattern. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
822ac004ea
commit
df8f17c1cb
1 changed files with 2 additions and 2 deletions
|
|
@ -41,8 +41,8 @@ func (h *ResponseHandler) ValidateResponse(resp *Message, expectedType MessageTy
|
|||
return nil
|
||||
}
|
||||
|
||||
// ParseResponse validates the response and parses the payload into the target.
|
||||
// This combines ValidateResponse and ParsePayload into a single call.
|
||||
// var stats StatsPayload
|
||||
// if err := handler.ParseResponse(resp, MsgStats, &stats); err != nil { return nil, err }
|
||||
func (h *ResponseHandler) ParseResponse(resp *Message, expectedType MessageType, target interface{}) error {
|
||||
if err := h.ValidateResponse(resp, expectedType); err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue