Skip to content

Commit

Permalink
tidy comments and go mod init
Browse files Browse the repository at this point in the history
  • Loading branch information
louism517 committed May 1, 2020
1 parent 9212627 commit 8aa3d52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 2 additions & 4 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,18 @@ func NewClient(config *Config) (*Client, error) {
return nil, err
}

// Added timeout to http client
// Timeout of zero means no timeout
t := &http.Transport{
TLSClientConfig: config.TLSClientConfig,
TLSNextProto: map[string]func(authority string, c *tls.Conn) http.RoundTripper{},
}

// Add timeout to http client
// Timeout of zero means no timeout
h := &http.Client{
Timeout: config.Timeout,
Transport: t,
}

// need to disable http/2 as it doesn't play nicely with nginx
// to do so we set TLSNextProto to an empty, non-nil map
c := &Client{
Config: config,
BaseURL: baseURL,
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/spaceapegames/go-wavefront

go 1.13

0 comments on commit 8aa3d52

Please sign in to comment.