fix golint errors

This commit is contained in:
Philippe-Adrien Nousse 2018-07-30 10:08:35 +02:00
parent 91df4845ea
commit 17ca4cbf14
4 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ import (
"github.com/partitio/gonextcloud/types" "github.com/partitio/gonextcloud/types"
) )
var unauthorized = fmt.Errorf("login first") var errUnauthorized = fmt.Errorf("login first")
// Login perform login and create a session with the Nextcloud API. // Login perform login and create a session with the Nextcloud API.
func (c *Client) Login(username string, password string) error { func (c *Client) Login(username string, password string) error {

View File

@ -2,7 +2,7 @@ package gonextcloud
import "net/url" import "net/url"
// Route references the available routes // Routes references the available routes
type Routes struct { type Routes struct {
capabilities *url.URL capabilities *url.URL
users *url.URL users *url.URL

View File

@ -220,7 +220,7 @@ func (c *Client) UserGroupDemote(name string, group string) error {
//UserGroupSubAdminList lists the groups where he is subadmin //UserGroupSubAdminList lists the groups where he is subadmin
func (c *Client) UserGroupSubAdminList(name string) ([]string, error) { func (c *Client) UserGroupSubAdminList(name string) ([]string, error) {
if !c.loggedIn() { if !c.loggedIn() {
return nil, unauthorized return nil, errUnauthorized
} }
u := c.baseURL.ResolveReference(routes.users) u := c.baseURL.ResolveReference(routes.users)
u.Path = path.Join(u.Path, name, "subadmins") u.Path = path.Join(u.Path, name, "subadmins")

View File

@ -12,7 +12,7 @@ import (
func (c *Client) baseRequest(route *url.URL, name string, subroute string, ro *req.RequestOptions, method string) (*req.Response, error) { func (c *Client) baseRequest(route *url.URL, name string, subroute string, ro *req.RequestOptions, method string) (*req.Response, error) {
if !c.loggedIn() { if !c.loggedIn() {
return nil, unauthorized return nil, errUnauthorized
} }
u := c.baseURL.ResolveReference(route) u := c.baseURL.ResolveReference(route)
if name != "" { if name != "" {