From 48c393bd8b9bcf3a4f2c3fd637244b9d5eb127e4 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Fri, 14 Apr 2017 00:59:54 +0900 Subject: [PATCH] remove needless slash --- mastodon.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mastodon.go b/mastodon.go index 7f1c878..93efebe 100644 --- a/mastodon.go +++ b/mastodon.go @@ -37,7 +37,7 @@ func (c *client) Authenticate(username, password string) error { params.Set("grant_type", "password") params.Set("username", username) params.Set("password", password) - req, err := http.NewRequest("POST", fmt.Sprintf("%s/%s", c.config.Server, "/oauth/token"), strings.NewReader(params.Encode())) + req, err := http.NewRequest("POST", fmt.Sprintf("%s%s", c.config.Server, "/oauth/token"), strings.NewReader(params.Encode())) if err != nil { return err } @@ -50,7 +50,7 @@ func (c *client) Authenticate(username, password string) error { res := struct { AccessToken string `json:"access_token"` }{} - err = json.NewDecoder(resp.Body).Decode(&res) + err = json.NewDecoder(io.TeeReader(resp.Body, os.Stdout)).Decode(&res) if err != nil { return err } @@ -98,7 +98,7 @@ type Timeline struct { } func (c *client) GetTimeline(path string) ([]Timeline, error) { - req, err := http.NewRequest("GET", fmt.Sprintf("%s/%s", c.config.Server, "/api/v1/timelines/home"), nil) + req, err := http.NewRequest("GET", fmt.Sprintf("%s%s", c.config.Server, "/api/v1/timelines/home"), nil) if err != nil { return nil, err }