Skip to content

Commit

Permalink
More linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mcpherrinm committed May 24, 2024
1 parent 4f2f91a commit ed41b53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 3 additions & 6 deletions challtestsrv/challenge-servers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package challtestsrv

import (
"fmt"
"errors"
"log"
"net/http"
"os"
Expand Down Expand Up @@ -118,7 +118,7 @@ func (c *Config) validate() error {
len(c.HTTPSOneAddrs) < 1 &&
len(c.DNSOneAddrs) < 1 &&
len(c.TLSALPNOneAddrs) < 1 {
return fmt.Errorf(
return errors.New(
"config must specify at least one HTTPOneAddrs entry, one HTTPSOneAddr " +
"entry, one DOHAddrs, one DNSOneAddrs entry, or one TLSALPNOneAddrs entry")
}
Expand Down Expand Up @@ -177,10 +177,7 @@ func New(config Config) (*ChallSrv, error) {

for _, address := range config.DOHAddrs {
challSrv.log.Printf("Creating DoH server on %s\n", address)
s, err := dohServer(address, config.DOHCert, config.DOHCertKey, http.HandlerFunc(challSrv.dohHandler))
if err != nil {
return nil, err
}
s := dohServer(address, config.DOHCert, config.DOHCertKey, http.HandlerFunc(challSrv.dohHandler))
challSrv.servers = append(challSrv.servers, s)
}

Expand Down
4 changes: 2 additions & 2 deletions challtestsrv/dnsone.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (s *doh) ListenAndServe() error {
}

// dohServer creates a DoH server.
func dohServer(address string, tlsCert, tlsCertKey string, handler http.Handler) (*doh, error) {
func dohServer(address string, tlsCert, tlsCertKey string, handler http.Handler) *doh {

Check failure on line 75 in challtestsrv/dnsone.go

View workflow job for this annotation

GitHub Actions / go-lint-checks

dohServer returns interface (github.com/letsencrypt/pebble/v2/challtestsrv.challengeServer) (ireturn)
return &doh{
&http.Server{
Handler: handler,
Expand All @@ -82,5 +82,5 @@ func dohServer(address string, tlsCert, tlsCertKey string, handler http.Handler)
},
tlsCert,
tlsCertKey,
}, nil
}
}

0 comments on commit ed41b53

Please sign in to comment.