Skip to content

Commit

Permalink
Fix bufio flush
Browse files Browse the repository at this point in the history
  • Loading branch information
cube2222 committed Dec 30, 2019
1 parent 2ba5f13 commit db94bc2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ var rootCmd = &cobra.Command{
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
input := json.NewDecoder(bufio.NewReaderSize(os.Stdin, 4096*16))
output := json.NewEncoder(bufio.NewWriterSize(os.Stdout, 4096*16))
w := bufio.NewWriterSize(os.Stdout, 4096*16)
defer w.Flush()
output := json.NewEncoder(w)
output.SetIndent("", " ")

app := app.NewApp(args[0], input, output)
Expand Down

0 comments on commit db94bc2

Please sign in to comment.