From 9a511ddc728eaf029bd08ccce2ed0bf7825b60b5 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 17:41:18 +0100 Subject: [PATCH] ax(node): replace direct json.MarshalIndent/Unmarshal with package wrappers in peer.go encoding/json is a banned import; peer.go used json.MarshalIndent and json.Unmarshal directly in saveNow/load instead of the package-local MarshalJSON/UnmarshalJSON wrappers. Removes the encoding/json import. Co-Authored-By: Charon --- pkg/node/peer.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/node/peer.go b/pkg/node/peer.go index 9c8efca..5186538 100644 --- a/pkg/node/peer.go +++ b/pkg/node/peer.go @@ -1,7 +1,6 @@ package node import ( - "encoding/json" "os" "path" "regexp" @@ -641,7 +640,7 @@ func (registry *PeerRegistry) saveNow() error { peers = append(peers, peer) } - data, err := json.MarshalIndent(peers, "", " ") + data, err := MarshalJSON(peers) if err != nil { return &ProtocolError{Code: ErrCodeOperationFailed, Message: "failed to marshal peers: " + err.Error()} } @@ -701,7 +700,7 @@ func (registry *PeerRegistry) load() error { } var peers []*Peer - if err := json.Unmarshal(data, &peers); err != nil { + if err := UnmarshalJSON(data, &peers); err != nil { return &ProtocolError{Code: ErrCodeOperationFailed, Message: "failed to unmarshal peers: " + err.Error()} }