Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

itembase: fix errors found by vet #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,9 @@ func (c *client) GetAllInto(destination interface {
}

for _, document := range response.Documents {
if destination.Add != nil {
err = destination.Add(document)
if err != nil {
log.Info("Error when adding document", "error", err)
}
err = destination.Add(document)
if err != nil {
log.Info("Error when adding document", "error", err)
}
}

Expand Down Expand Up @@ -180,11 +178,9 @@ func (c *client) GetAllInto(destination interface {
}

for _, document := range response.Documents {
if destination.Add != nil {
destination.Add(document)
if err != nil {
log.Info("Error when adding document", "error", err)
}
destination.Add(document)
if err != nil {
log.Info("Error when adding document", "error", err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (c *client) getUserToken(userID string) (token *oauth2.Token) {

_, err = client.Get(c.me)
if err == nil {
fmt.Errorf("Fetch should return an error if no refresh token is set")
log.Printf("Fetch should return an error if no refresh token is set")
}

token, err = client.Transport.(*oauth2.Transport).Source.Token()
Expand Down