Skip to content

Commit 6baa19e

Browse files
docs: Clarify nil http.Client usage has no timeout (#3910)
1 parent 4456d12 commit 6baa19e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

github/github.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,10 @@ func addOptions(s string, opts any) (string, error) {
336336
// authentication, either use Client.WithAuthToken or provide NewClient with
337337
// an http.Client that will perform the authentication for you (such as that
338338
// provided by the golang.org/x/oauth2 library).
339+
//
340+
// Note: When using a nil httpClient, the default client has no timeout set.
341+
// This may not be suitable for production environments. It is recommended to
342+
// provide a custom http.Client with an appropriate timeout.
339343
func NewClient(httpClient *http.Client) *Client {
340344
if httpClient == nil {
341345
httpClient = &http.Client{}

0 commit comments

Comments
 (0)