Decrease pressure on garbage collector
zbindenren opened this issue · 0 comments
zbindenren commented
Hi
I observed that on each api call a http.Client
is created: https://github.com/scottdware/go-bigip/blob/master/bigip.go#L119
I would like to refactor that code to initiate a http.Client in NewSession
and use this client for each call.
To do that, the Transport has also to be created in NewSession
. My plan:
- move the Transport configuration to
ConfigOptions
like
type ConfigOptions struct {
APICallTimeout time.Duration
Transport *http.Transport
}
- do not use
InsecureSkipVerify: true,
like here
What do you think about that?