mirror of
https://github.com/MedzikUser/go-github-selfupdate.git
synced 2024-08-15 03:25:29 +00:00
remove httpClient field of Updater instance which is not used
This commit is contained in:
parent
7b77ed8d85
commit
8fd62fcf16
1 changed files with 5 additions and 6 deletions
|
@ -16,7 +16,6 @@ import (
|
|||
type Updater struct {
|
||||
api *github.Client
|
||||
apiCtx context.Context
|
||||
httpClient *http.Client
|
||||
}
|
||||
|
||||
// Config represents the configuration of self-update.
|
||||
|
@ -54,7 +53,7 @@ func NewUpdater(config Config) (*Updater, error) {
|
|||
|
||||
if config.EnterpriseBaseURL == "" {
|
||||
client := github.NewClient(hc)
|
||||
return &Updater{client, ctx, hc}, nil
|
||||
return &Updater{client, ctx}, nil
|
||||
}
|
||||
|
||||
if token == "" {
|
||||
|
@ -68,7 +67,7 @@ func NewUpdater(config Config) (*Updater, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &Updater{client, ctx, hc}, nil
|
||||
return &Updater{client, ctx}, nil
|
||||
}
|
||||
|
||||
// DefaultUpdater creates a new updater instance with default configuration.
|
||||
|
@ -81,5 +80,5 @@ func DefaultUpdater() *Updater {
|
|||
}
|
||||
ctx := context.Background()
|
||||
client := newHTTPClient(ctx, token)
|
||||
return &Updater{github.NewClient(client), ctx, client}
|
||||
return &Updater{github.NewClient(client), ctx}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue