mirror of
https://github.com/outbackdingo/certificates.git
synced 2026-01-27 10:18:34 +00:00
Apply suggestions from code review
Co-authored-by: Herman Slatman <hslatman@users.noreply.github.com>
This commit is contained in:
@@ -28,8 +28,8 @@ import (
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
if err := initializeSystemCertPool(); err != nil {
|
||||
fmt.Fprintln(os.Stderr, "failed to initialize system cert pool:", err)
|
||||
fmt.Fprintln(os.Stderr, "See https://pkg.go.dev/github.com/tjfoc/gmsm/x509#SystemCertPool\n", err)
|
||||
fmt.Fprintf(os.Stderr, "failed to initialize system cert pool: %v\n", err)
|
||||
fmt.Fprintln(os.Stderr, "See https://pkg.go.dev/crypto/x509#SystemCertPool")
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
|
||||
@@ -7,14 +7,14 @@ import (
|
||||
"github.com/smallstep/certificates/internal/httptransport"
|
||||
)
|
||||
|
||||
// Transporter is the implemented by custom HTTP clients with a method that
|
||||
// Transporter is implemented by custom HTTP clients with a method that
|
||||
// returns an [*http.Transport].
|
||||
type Transporter interface {
|
||||
Transport() *http.Transport
|
||||
}
|
||||
|
||||
// Client returns an HTTP client that uses a [sync.Pool] to create new HTTP
|
||||
// client. It implements the [provisioner.HTTPClient] and [Transporter]
|
||||
// Client is an HTTP client that uses a [sync.Pool] to create new and reuse HTTP
|
||||
// clients. It implements the [provisioner.HTTPClient] and [Transporter]
|
||||
// interfaces. This is the HTTP client used by the provisioners.
|
||||
type Client struct {
|
||||
pool sync.Pool
|
||||
@@ -38,7 +38,7 @@ func (c *Client) SetNew(fn func() *http.Client) {
|
||||
}
|
||||
}
|
||||
|
||||
// Get issues a GET to the specified URL. If the response is one of the
|
||||
// Get issues a GET request to the specified URL. If the response is one of the
|
||||
// following redirect codes, Get follows the redirect after calling the
|
||||
// [Client.CheckRedirect] function:
|
||||
func (c *Client) Get(u string) (resp *http.Response, err error) {
|
||||
|
||||
Reference in New Issue
Block a user