소스 검색

Apply suggestions from code review

Co-authored-by: Herman Slatman <hslatman@users.noreply.github.com>
Mariano Cano 1 년 전
부모
커밋
2b13b82ee3
2개의 변경된 파일과 6개의 추가작업 그리고 6개의 파일을 삭제
  1. 2 2
      authority/authority_test.go
  2. 4 4
      authority/poolhttp/poolhttp.go

+ 2 - 2
authority/authority_test.go

@@ -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)
 	}
 

+ 4 - 4
authority/poolhttp/poolhttp.go

@@ -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) {