From 388af4d1e36c8444c5a0e307f28ac2214b8928f0 Mon Sep 17 00:00:00 2001 From: boypt <1033514+boypt@users.noreply.github.com> Date: Fri, 17 May 2019 19:14:42 +0800 Subject: [PATCH] fix stdin type mismatch in windows --- infra/conf/command/command.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/infra/conf/command/command.go b/infra/conf/command/command.go index 9f8c12d5..532ba2b8 100644 --- a/infra/conf/command/command.go +++ b/infra/conf/command/command.go @@ -3,6 +3,7 @@ package command //go:generate errorgen import ( + "bufio" "os" "github.com/golang/protobuf/proto" @@ -27,7 +28,7 @@ func (c *ConfigCommand) Description() control.Description { } func (c *ConfigCommand) Execute(args []string) error { - pbConfig, err := serial.LoadJSONConfig(os.Stdin) + pbConfig, err := serial.LoadJSONConfig(bufio.NewReader(os.Stdin)) if err != nil { return newError("failed to parse json config").Base(err) }