]> Sergey Matveev's repositories - btrtrc.git/commitdiff
cmd/torrent-metainfo-pprint: Use bufio input and enable envpprof
authorMatt Joiner <anacrolix@gmail.com>
Sun, 17 Jun 2018 06:20:02 +0000 (16:20 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Sun, 17 Jun 2018 06:20:02 +0000 (16:20 +1000)
cmd/torrent-metainfo-pprint/main.go

index 7320315aa4f3cf01505cfba9e9ca93bec7c5a560..52c6c1069ec323002d974dd07d21eabe797c698a 100644 (file)
@@ -1,6 +1,7 @@
 package main
 
 import (
+       "bufio"
        "encoding/hex"
        "encoding/json"
        "fmt"
@@ -8,6 +9,7 @@ import (
        "log"
        "os"
 
+       "github.com/anacrolix/envpprof"
        "github.com/anacrolix/tagflag"
        "github.com/bradfitz/iter"
 
@@ -62,8 +64,9 @@ func processReader(r io.Reader) error {
 }
 
 func main() {
+       defer envpprof.Stop()
        tagflag.Parse(&flags)
-       err := processReader(os.Stdin)
+       err := processReader(bufio.NewReader(os.Stdin))
        if err != nil {
                log.Fatal(err)
        }