Fix for ineffassign .

pull/34/head
178inaba 2017-04-20 21:29:10 +09:00
parent 68843f4dd0
commit d1b5f4b1fb
3 changed files with 7 additions and 3 deletions

View File

@ -193,11 +193,11 @@ func TestGetAccountFollowing(t *testing.T) {
ClientSecret: "bar",
AccessToken: "zoo",
})
fl, err := client.GetAccountFollowing(context.Background(), 123)
_, err := client.GetAccountFollowing(context.Background(), 123)
if err == nil {
t.Fatalf("should be fail: %v", err)
}
fl, err = client.GetAccountFollowing(context.Background(), 1234567)
fl, err := client.GetAccountFollowing(context.Background(), 1234567)
if err != nil {
t.Fatalf("should not be fail: %v", err)
}

View File

@ -78,7 +78,8 @@ func prompt() (string, string, error) {
fmt.Print("Password: ")
var password string
if readPassword == nil {
t, err := tty.Open()
var t *tty.TTY
t, err = tty.Open()
if err != nil {
return "", "", err
}

View File

@ -128,6 +128,9 @@ func (c *Client) doAPI(ctx context.Context, method string, uri string, params in
ct = mw.FormDataContentType()
} else {
req, err = http.NewRequest(method, u.String(), nil)
if err != nil {
return err
}
}
req = req.WithContext(ctx)
req.Header.Set("Authorization", "Bearer "+c.config.AccessToken)