Skip to content

Commit

Permalink
chore: fmt output of config-host-enable
Browse files Browse the repository at this point in the history
  • Loading branch information
laocheng.cheng committed Mar 10, 2022
1 parent 55484c1 commit 89a57e6
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions core/commands/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,14 @@ var storageHostEnableCmd = &cmds.Command{
return err
}

fmt.Println("set storage-host-enable =", enable)
return nil
out := fmt.Sprintf("set storage-host-enable = %v \n", enable)
return cmds.EmitOnce(res, &out)
},
Encoders: cmds.EncoderMap{
cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, out *string) error {
_, err := w.Write([]byte(*out))
return err
}),
},
}

Expand All @@ -350,8 +356,14 @@ var SyncChainInfoCmd = &cmds.Command{
return err
}

fmt.Println("sync chain info ok.")
return nil
out := fmt.Sprintf("sync chain info ok. \n")
return cmds.EmitOnce(res, &out)
},
Encoders: cmds.EncoderMap{
cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, out *string) error {
_, err := w.Write([]byte(*out))
return err
}),
},
}

Expand Down

0 comments on commit 89a57e6

Please sign in to comment.