Fix for ineffassign .
This commit is contained in:
parent
68843f4dd0
commit
d1b5f4b1fb
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user