aboutsummaryrefslogtreecommitdiff
path: root/request.go
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2020-12-17 17:16:55 -0500
committerAdnan Maolood <[email protected]>2020-12-17 17:16:55 -0500
commit176b260468e9d586d79b55d853289bc3e87785dd (patch)
treede2f130723e92d0ce9b6efc2a0625d7faaa67105 /request.go
parentFix locking up of KnownHostsFile and CertificateDir (diff)
downloadgo-gemini-176b260468e9d586d79b55d853289bc3e87785dd.tar.xz
go-gemini-176b260468e9d586d79b55d853289bc3e87785dd.zip
Allow Request.Context to be nil
Diffstat (limited to 'request.go')
-rw-r--r--request.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/request.go b/request.go
index b4c95c2..138fc15 100644
--- a/request.go
+++ b/request.go
@@ -36,7 +36,7 @@ type Request struct {
TLS tls.ConnectionState
// Context specifies the context to use for client requests.
- // Context must not be nil.
+ // If Context is nil, the background context will be used.
Context context.Context
}
@@ -60,9 +60,8 @@ func NewRequestFromURL(url *url.URL) *Request {
host += ":1965"
}
return &Request{
- URL: url,
- Host: host,
- Context: context.Background(),
+ URL: url,
+ Host: host,
}
}