From 7444c46aa1337be7043fe3a1406b8993d43a703d Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 2 Sep 2019 13:25:26 +0100 Subject: [PATCH] Fix -json flag when running -genconf --- src/config/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/config.go b/src/config/config.go index 5257b545..fb9a2edd 100644 --- a/src/config/config.go +++ b/src/config/config.go @@ -65,7 +65,7 @@ func (cfg *NodeConfig) NewSigningKeys() { // MarshalJSON exports the configuration into JSON format. No comments are // included in the JSON export as comments are not valid in pure JSON. func (cfg *NodeConfig) MarshalJSON() ([]byte, error) { - bs, err := json.MarshalIndent(cfg, "", " ") + bs, err := json.MarshalIndent(*cfg, "", " ") if err != nil { return nil, err } @@ -75,7 +75,7 @@ func (cfg *NodeConfig) MarshalJSON() ([]byte, error) { // MarshalHJSON exports the configuration into HJSON format, complete with // comments describing what each configuration item does. func (cfg *NodeConfig) MarshalHJSON() ([]byte, error) { - bs, err := hjson.Marshal(cfg) + bs, err := hjson.Marshal(*cfg) if err != nil { return nil, err }