Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
bhperry committed Sep 18, 2024
1 parent c588822 commit 980e2db
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion httpreq/httpreq.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ func (hrs *httpReqSolver) challengeRequest(ch *acme.ChallengeRequest) error {

body := ChallengeBody{Fqdn: ch.ResolvedFQDN, Value: ch.Key}
var buffer bytes.Buffer
json.NewEncoder(&buffer).Encode(body)
if err = json.NewEncoder(&buffer).Encode(body); err != nil {
return err
}

request, err := http.NewRequest("POST", url, &buffer)
if err != nil {
Expand Down
5 changes: 4 additions & 1 deletion mock/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ func (d *DNS) handleDNSRequest(w dns.ResponseWriter, req *dns.Msg) {
}
}
}
w.WriteMsg(msg)
err := w.WriteMsg(msg)
if err != nil {
panic(err)
}
}

func (d *DNS) addDNSAnswer(q dns.Question, msg *dns.Msg, req *dns.Msg) error {
Expand Down
5 changes: 4 additions & 1 deletion mock/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ func (hre *HTTPReqEndpoint) serveHTTP(w http.ResponseWriter, r *http.Request) {
var body map[string]string
err := json.NewDecoder(r.Body).Decode(&body)
if err != nil {
w.Write([]byte(err.Error()))
_, err = w.Write([]byte(err.Error()))
if err != nil {
panic(err)
}
w.WriteHeader(http.StatusBadRequest)
return
}
Expand Down

0 comments on commit 980e2db

Please sign in to comment.