Skip to content

Commit

Permalink
fix: golang inspection errors
Browse files Browse the repository at this point in the history
  • Loading branch information
will7200 committed Jul 20, 2020
1 parent 06eefc9 commit 927740f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
3 changes: 0 additions & 3 deletions cmd/crypto-sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ func (s *SyncCmd) Run(ctx *Context) error {
if holding == "coinbase" {
pricingData = holdingsProvider.(holdings.Price)
}
if err != nil {
return err
}
uHolding, err := account.GetHoldings()
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion pkg/personalcapital/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func (a *Accounts) GetAccounts(ctx context.Context, request *GetAccountsRequest)
return nil, err
}
if resp.StatusCode != 200 {
return nil, errors.New("Non 200 response")
return nil, errors.New("non 200 response")
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/personalcapital/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func SaveSession(inClient *http.Client, baseURL string, fileName string) {
}

// LoadSession loads the cookies from a previously saved session file.
func LoadSession(cookies *[]*(http.Cookie), fileName string) {
func LoadSession(cookies *[]*http.Cookie, fileName string) {
cookiesFile, err := ioutil.ReadFile(fileName)
if err != nil {
log.Println(err)
Expand Down
16 changes: 8 additions & 8 deletions pkg/personalcapital/holdings.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (h *Holdings) GetHoldings(ctx context.Context, params *GetHoldingsParams) (
return nil, err
}
if resp.StatusCode != 200 {
return nil, errors.New("Non 200 response")
return nil, errors.New("non 200 response")
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
Expand All @@ -132,15 +132,15 @@ func (h *Holdings) GetHoldings(ctx context.Context, params *GetHoldingsParams) (
if err != nil {
return nil, err
}
holdings := new(GetHoldingsResponse)
holdings.SpData = ghr.SpData
lHoldings := new(GetHoldingsResponse)
lHoldings.SpData = ghr.SpData
if params.FilterUserCreated {
holdings.Holdings = FilterHoldsFromUser(holdings.Holdings)
lHoldings.Holdings = FilterHoldsFromUser(lHoldings.Holdings)
}
if params.FilterAccountName != "" {
holdings.Holdings = FilterHoldsByAccountName(holdings.Holdings, params.FilterAccountName)
lHoldings.Holdings = FilterHoldsByAccountName(lHoldings.Holdings, params.FilterAccountName)
}
return holdings, nil
return lHoldings, nil
}

func PCHoldingsToIHoldings(h []HoldingsType) []holdings.IHolding {
Expand Down Expand Up @@ -261,7 +261,7 @@ func (h *Holdings) UpdateHoldings(ctx context.Context, holding HoldingsUpdateReq
return nil, err
}
if resp.StatusCode != 200 {
return nil, errors.New("Non 200 response")
return nil, errors.New("non 200 response")
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
Expand Down Expand Up @@ -357,7 +357,7 @@ func (h *Holdings) AddHolding(ctx context.Context, holding *HoldingAddRequest) (
return nil, err
}
if resp.StatusCode != 200 {
return nil, errors.New("Non 200 response")
return nil, errors.New("non 200 response")
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/personalcapital/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (a *Authentication) AuthenticateWithPassword(ctx context.Context, params Au
}

if resp.StatusCode != 200 {
return errors.New("Non 200 response")
return errors.New("non 200 response")
}

body, err := ioutil.ReadAll(resp.Body)
Expand Down

0 comments on commit 927740f

Please sign in to comment.