Skip to content

Commit

Permalink
Fix errcheck errors in experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbourgon committed May 26, 2015
1 parent 84454d1 commit 2f16729
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions experimental/example/goapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,12 @@ func get(target string) {
log.Printf("%s: %v", target, err)
return
}
defer resp.Body.Close()
log.Printf("%s: %s", target, resp.Status)
io.Copy(ioutil.Discard, resp.Body)
resp.Body.Close()
if _, err := io.Copy(ioutil.Discard, resp.Body); err != nil {
log.Printf("%s: %v", target, err)
return
}
}

func interrupt() error {
Expand Down
5 changes: 4 additions & 1 deletion experimental/genreport/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ package main
import (
"encoding/json"
"flag"
"log"
"os"
)

func main() {
nodes := flag.Int("nodes", 10, "node count")
flag.Parse()
json.NewEncoder(os.Stdout).Encode(DemoReport(*nodes))
if err := json.NewEncoder(os.Stdout).Encode(DemoReport(*nodes)); err != nil {
log.Print(err)
}
}

0 comments on commit 2f16729

Please sign in to comment.