Skip to content

Commit

Permalink
only support JSON for the moment
Browse files Browse the repository at this point in the history
  • Loading branch information
miku committed Jan 8, 2018
1 parent 6a485af commit 06e2f07
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cmd/solrdump/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,15 @@ func main() {
if err != nil {
log.Fatal(err)
}
dec := json.NewDecoder(resp.Body)
var response Response
if err := dec.Decode(&response); err != nil {
log.Fatal(err)
switch *wt {
case "json":
dec := json.NewDecoder(resp.Body)
if err := dec.Decode(&response); err != nil {
log.Fatal(err)
}
default:
log.Fatalf("wt=%s not implemented", *wt)
}
// We do not defer, since we hard-exit on errors anyway.
if err := resp.Body.Close(); err != nil {
Expand Down

0 comments on commit 06e2f07

Please sign in to comment.