From 7961e3e8bc258a837b95d1dfc5b2d47130099195 Mon Sep 17 00:00:00 2001 From: demo Date: Sun, 10 May 2026 21:58:52 -0400 Subject: style: rename fetch to Fetch + add doc comment --- internal/fetch/fetch.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'internal/fetch/fetch.go') diff --git a/internal/fetch/fetch.go b/internal/fetch/fetch.go index f508922..f22139d 100644 --- a/internal/fetch/fetch.go +++ b/internal/fetch/fetch.go @@ -8,7 +8,11 @@ import ( "time" ) -func fetch(rawURL string, timeoutSecs int) (io.Reader, error) { +// Fetch makes a GET request to rawURL, returning the HTML contents of +// that webpage in the form of an [io.Reader]. An error is also +// returned. The parameter timeoutSecs is passed directly to the +// [http.Client.Timeout] field of the client making the request. +func Fetch(rawURL string, timeoutSecs int) (io.Reader, error) { client := http.Client{ Timeout: time.Duration(timeoutSecs) * time.Second, } -- cgit v1.2.3