diff --git a/auth.go b/auth.go index 07b3d5d..f15e2b2 100644 --- a/auth.go +++ b/auth.go @@ -6,7 +6,7 @@ import ( "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. func (c *Client) Login(username string, password string) error { diff --git a/routes.go b/routes.go index 9e26741..d008449 100644 --- a/routes.go +++ b/routes.go @@ -2,7 +2,7 @@ package gonextcloud import "net/url" -// Route references the available routes +// Routes references the available routes type Routes struct { capabilities *url.URL users *url.URL diff --git a/users.go b/users.go index 9659adf..36c3a43 100644 --- a/users.go +++ b/users.go @@ -220,7 +220,7 @@ func (c *Client) UserGroupDemote(name string, group string) error { //UserGroupSubAdminList lists the groups where he is subadmin func (c *Client) UserGroupSubAdminList(name string) ([]string, error) { if !c.loggedIn() { - return nil, unauthorized + return nil, errUnauthorized } u := c.baseURL.ResolveReference(routes.users) u.Path = path.Join(u.Path, name, "subadmins") diff --git a/utils.go b/utils.go index 94b0863..2e6588a 100644 --- a/utils.go +++ b/utils.go @@ -12,7 +12,7 @@ import ( func (c *Client) baseRequest(route *url.URL, name string, subroute string, ro *req.RequestOptions, method string) (*req.Response, error) { if !c.loggedIn() { - return nil, unauthorized + return nil, errUnauthorized } u := c.baseURL.ResolveReference(route) if name != "" {