aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-02-23 18:45:58 -0500
committerAdnan Maolood <[email protected]>2021-02-23 18:45:58 -0500
commit02bbedc330bc4b241438236807d95cf024044a4d (patch)
treef8c1c74bea327ac4236fcbe2c141ef0e7349f9c1 /client.go
parentUpdate documentation (diff)
downloadgo-gemini-02bbedc330bc4b241438236807d95cf024044a4d.tar.xz
go-gemini-02bbedc330bc4b241438236807d95cf024044a4d.zip
Update documentation
Diffstat (limited to 'client.go')
-rw-r--r--client.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/client.go b/client.go
index a9497c3..44191c6 100644
--- a/client.go
+++ b/client.go
@@ -15,10 +15,10 @@ import (
// A Client is a Gemini client. Its zero value is a usable client.
type Client struct {
- // TrustCertificate is called to determine whether the client
- // should trust the certificate provided by the server.
- // If TrustCertificate is nil, the client will accept any certificate.
- // If the returned error is not nil, the certificate will not be trusted
+ // TrustCertificate is called to determine whether the client should
+ // trust the certificate provided by the server.
+ // If TrustCertificate is nil or returns nil, the client will accept
+ // any certificate. Otherwise, the certificate will not be trusted
// and the request will be aborted.
//
// See the tofu submodule for an implementation of trust on first use.
@@ -36,8 +36,7 @@ type Client struct {
// An error is returned if there was a Gemini protocol error.
// A non-2x status code doesn't cause an error.
//
-// If the returned error is nil, the Response will contain a non-nil Body
-// which the user is expected to close.
+// If the returned error is nil, the user is expected to close the Response.
//
// For more control over requests, use NewRequest and Client.Do.
func (c *Client) Get(ctx context.Context, url string) (*Response, error) {
@@ -55,8 +54,7 @@ func (c *Client) Get(ctx context.Context, url string) (*Response, error) {
// An error is returned if there was a Gemini protocol error.
// A non-2x status code doesn't cause an error.
//
-// If the returned error is nil, the Response will contain a non-nil Body
-// which the user is expected to close.
+// If the returned error is nil, the user is expected to close the Response.
//
// Generally Get will be used instead of Do.
func (c *Client) Do(ctx context.Context, req *Request) (*Response, error) {