fix stdin type mismatch in windows

pull/2531/head
boypt 2019-05-17 19:14:42 +08:00 committed by Nicholas Wang
parent 774bdf202b
commit f426c5cce5
No known key found for this signature in database
GPG Key ID: F20CA399C9BD9100
1 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package command
//go:generate errorgen //go:generate errorgen
import ( import (
"bufio"
"os" "os"
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
@ -27,7 +28,7 @@ func (c *ConfigCommand) Description() control.Description {
} }
func (c *ConfigCommand) Execute(args []string) error { func (c *ConfigCommand) Execute(args []string) error {
pbConfig, err := serial.LoadJSONConfig(os.Stdin) pbConfig, err := serial.LoadJSONConfig(bufio.NewReader(os.Stdin))
if err != nil { if err != nil {
return newError("failed to parse json config").Base(err) return newError("failed to parse json config").Base(err)
} }