diff --git a/auth.go b/auth.go index ed9e336..84dc092 100644 --- a/auth.go +++ b/auth.go @@ -38,10 +38,8 @@ func (c *Client) LogIn(username, pass string) (*AuthUser, error) { return nil, fmt.Errorf("User does not exist.") } else if status == http.StatusTooManyRequests { return nil, fmt.Errorf("Stop repeatedly trying to log in.") - } else { - return nil, fmt.Errorf("Problem authenticating: %s. %v\n", status, err) } - return u, nil + return nil, fmt.Errorf("Problem authenticating: %s. %v\n", status, err) } func (c *Client) isNotLoggedIn(code int) bool { diff --git a/collection.go b/collection.go index dc808b4..be68f3b 100644 --- a/collection.go +++ b/collection.go @@ -80,8 +80,6 @@ func (c *Client) CreateCollection(sp *CollectionParams) (*Collection, error) { return nil, fmt.Errorf("Collection name is already taken.") } else if status == http.StatusPreconditionFailed { return nil, fmt.Errorf("Reached max collection quota.") - } else { - return nil, fmt.Errorf("Problem getting post: %s. %v\n", status, err) } - return p, nil + return nil, fmt.Errorf("Problem getting post: %s. %v\n", status, err) } diff --git a/post.go b/post.go index 7f361ae..f0f214c 100644 --- a/post.go +++ b/post.go @@ -81,10 +81,8 @@ func (c *Client) GetPost(id string) (*Post, error) { return nil, fmt.Errorf("Post not found.") } else if status == http.StatusGone { return nil, fmt.Errorf("Post unpublished.") - } else { - return nil, fmt.Errorf("Problem getting post: %s. %v\n", status, err) } - return p, nil + return nil, fmt.Errorf("Problem getting post: %s. %v\n", status, err) } // CreatePost publishes a new post, returning a user-friendly error if one comes @@ -133,10 +131,8 @@ func (c *Client) UpdatePost(sp *PostParams) (*Post, error) { return nil, fmt.Errorf("Not authenticated.") } else if status == http.StatusBadRequest { return nil, fmt.Errorf("Bad request: %s", env.ErrorMessage) - } else { - return nil, fmt.Errorf("Problem getting post: %s. %v\n", status, err) } - return p, nil + return nil, fmt.Errorf("Problem getting post: %s. %v\n", status, err) } // DeletePost permanently deletes a published post. See