Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
Signed-off-by: André Bauer <[email protected]>
  • Loading branch information
monotek committed Jan 22, 2025
1 parent 732bc5e commit deb1748
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pkg/pingdom-exporter/api_responses.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ type CheckResponse struct {
LastErrorTime int64 `json:"lasterrortime,omitempty"`
LastTestTime int64 `json:"lasttesttime,omitempty"`
LastResponseTime int64 `json:"lastresponsetime,omitempty"`
IntegrationIds []int `json:"integrationids,omitempty"`
IntegrationIDs []int `json:"integrationids,omitempty"`
SeverityLevel string `json:"severity_level,omitempty"`
Type CheckResponseType `json:"type,omitempty"`
Tags []CheckResponseTag `json:"tags,omitempty"`
UserIds []int `json:"userids,omitempty"`
UserIDs []int `json:"userids,omitempty"`
Teams []CheckTeamResponse `json:"teams,omitempty"`
ResponseTimeThreshold int `json:"responsetime_threshold,omitempty"`
ProbeFilters []string `json:"probe_filters,omitempty"`
Expand Down
9 changes: 2 additions & 7 deletions pkg/pingdom-exporter/pingdom.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"net/url"
)
Expand Down Expand Up @@ -115,13 +114,9 @@ func decodeResponse(r *http.Response, v interface{}) error {
return fmt.Errorf("nil interface provided to decodeResponse")
}

bodyBytes, err := io.ReadAll(r.Body)
if err != nil {
log.Println("Error reading request body:", err)
return err
}
bodyBytes, _ := io.ReadAll(r.Body)
bodyString := string(bodyBytes)
err = json.Unmarshal([]byte(bodyString), &v)
err := json.Unmarshal([]byte(bodyString), &v)
return err
}

Expand Down

0 comments on commit deb1748

Please sign in to comment.