Fix for ineffassign .
parent
68843f4dd0
commit
d1b5f4b1fb
|
@ -193,11 +193,11 @@ func TestGetAccountFollowing(t *testing.T) {
|
||||||
ClientSecret: "bar",
|
ClientSecret: "bar",
|
||||||
AccessToken: "zoo",
|
AccessToken: "zoo",
|
||||||
})
|
})
|
||||||
fl, err := client.GetAccountFollowing(context.Background(), 123)
|
_, err := client.GetAccountFollowing(context.Background(), 123)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Fatalf("should be fail: %v", err)
|
t.Fatalf("should be fail: %v", err)
|
||||||
}
|
}
|
||||||
fl, err = client.GetAccountFollowing(context.Background(), 1234567)
|
fl, err := client.GetAccountFollowing(context.Background(), 1234567)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("should not be fail: %v", err)
|
t.Fatalf("should not be fail: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,8 @@ func prompt() (string, string, error) {
|
||||||
fmt.Print("Password: ")
|
fmt.Print("Password: ")
|
||||||
var password string
|
var password string
|
||||||
if readPassword == nil {
|
if readPassword == nil {
|
||||||
t, err := tty.Open()
|
var t *tty.TTY
|
||||||
|
t, err = tty.Open()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", err
|
return "", "", err
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,6 +128,9 @@ func (c *Client) doAPI(ctx context.Context, method string, uri string, params in
|
||||||
ct = mw.FormDataContentType()
|
ct = mw.FormDataContentType()
|
||||||
} else {
|
} else {
|
||||||
req, err = http.NewRequest(method, u.String(), nil)
|
req, err = http.NewRequest(method, u.String(), nil)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
req = req.WithContext(ctx)
|
req = req.WithContext(ctx)
|
||||||
req.Header.Set("Authorization", "Bearer "+c.config.AccessToken)
|
req.Header.Set("Authorization", "Bearer "+c.config.AccessToken)
|
||||||
|
|
Loading…
Reference in New Issue