From c05c027a244158ab340ce1350c7fa1f56c5d32d7 Mon Sep 17 00:00:00 2001 From: Hongchao Deng Date: Thu, 20 Oct 2016 10:03:44 -0700 Subject: [PATCH] etcdctl: fix migrate in outputing client.Node to json Using printf will try to parse the string and replace special characters. In migrate code, we want to just output the raw json string of client.Node. For example, Printf("%\\") => %!\(MISSING) Print("%\\") => %\ Thus, we should use print instead. --- etcdctl/ctlv3/command/migrate_command.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etcdctl/ctlv3/command/migrate_command.go b/etcdctl/ctlv3/command/migrate_command.go index 99a8d5d4b..5b616c577 100644 --- a/etcdctl/ctlv3/command/migrate_command.go +++ b/etcdctl/ctlv3/command/migrate_command.go @@ -220,7 +220,7 @@ func writeKeys(w io.Writer, n *store.NodeExtern) uint64 { if err != nil { ExitWithError(ExitError, err) } - fmt.Fprintf(w, string(b)) + fmt.Fprint(w, string(b)) for _, nn := range nodes { max := writeKeys(w, nn) if max > maxIndex {