mirror of
https://gitlab.bertha.cloud/partitio/Nextcloud-Partitio/gonextcloud
synced 2024-11-06 00:06:24 +00:00
fix golint errors
This commit is contained in:
parent
91df4845ea
commit
17ca4cbf14
2
auth.go
2
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 {
|
||||
|
@ -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
|
||||
|
2
users.go
2
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")
|
||||
|
2
utils.go
2
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 != "" {
|
||||
|
Loading…
Reference in New Issue
Block a user