client: Make Get and Do accept a Context

This removes the need for Request.Context.
This commit is contained in:
Adnan Maolood
2021-02-20 13:37:08 -05:00
parent a7f958b20d
commit 3f4fd10b6d
3 changed files with 95 additions and 96 deletions

View File

@@ -2,7 +2,6 @@ package gemini
import (
"bufio"
"context"
"crypto/tls"
"io"
"net/url"
@@ -48,14 +47,6 @@ type Request struct {
// otherwise it leaves the field nil.
// This field is ignored by the Gemini client.
TLS *tls.ConnectionState
// Context specifies the context to use for outgoing requests.
// The context controls the entire lifetime of a request and its
// response: obtaining a connection, sending the request, and
// reading the response header and body.
// If Context is nil, the background context will be used.
// This field is ignored by the Gemini server.
Context context.Context
}
// NewRequest returns a new request.