Skip to content

Commit

Permalink
Removed more defer cancels and removed edits from vendor files.
Browse files Browse the repository at this point in the history
  • Loading branch information
meyer9 committed Dec 18, 2017
1 parent a5cddf3 commit a32d545
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions api/jsonapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -3495,8 +3495,7 @@ func (i *jsonAPIHandler) GETPeerInfo(w http.ResponseWriter, r *http.Request) {
ErrorResponse(w, http.StatusBadRequest, err.Error())
return
}
ctx, cancel := context.WithTimeout(context.Background(), time.Second*30)
defer cancel()
ctx, _ := context.WithTimeout(context.Background(), time.Second*30)
pi, err := i.node.IpfsNode.Routing.FindPeer(ctx, pid)
if err != nil {
ErrorResponse(w, http.StatusNotFound, err.Error())
Expand Down
6 changes: 3 additions & 3 deletions vendor/github.com/jessevdk/go-flags/parser.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ func UnmarshalString(v string) (string, error) {
}

func parseInt(s string, err *error) int {
v, errParse := strconv.ParseInt(s, 10, 64)
if errParse != nil {
*err = errParse
v, parseErr := strconv.ParseInt(s, 10, 64)
if parseErr != nil {
*err = parseErr
}
return int(v)
}
Expand Down

0 comments on commit a32d545

Please sign in to comment.