carddav: simplify variable names

This commit is contained in:
Simon Ser 2020-01-21 21:04:19 +01:00
parent ffc628aed9
commit 45774fe572
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
2 changed files with 10 additions and 10 deletions

View File

@ -103,21 +103,21 @@ func (c *Client) FindAddressBooks(addressBookHomeSet string) ([]AddressBook, err
return nil, err return nil, err
} }
var resTypeProp internal.ResourceType var resType internal.ResourceType
if err := resp.DecodeProp(&resTypeProp); err != nil { if err := resp.DecodeProp(&resType); err != nil {
return nil, err return nil, err
} }
if !resTypeProp.Is(addressBookName) { if !resType.Is(addressBookName) {
continue continue
} }
var descProp addressbookDescription var desc addressbookDescription
if err := resp.DecodeProp(&descProp); err != nil && !internal.IsNotFound(err) { if err := resp.DecodeProp(&desc); err != nil && !internal.IsNotFound(err) {
return nil, err return nil, err
} }
var dispNameProp internal.DisplayName var dispName internal.DisplayName
if err := resp.DecodeProp(&dispNameProp); err != nil && !internal.IsNotFound(err) { if err := resp.DecodeProp(&dispName); err != nil && !internal.IsNotFound(err) {
return nil, err return nil, err
} }
@ -131,8 +131,8 @@ func (c *Client) FindAddressBooks(addressBookHomeSet string) ([]AddressBook, err
l = append(l, AddressBook{ l = append(l, AddressBook{
Href: href, Href: href,
Name: dispNameProp.Name, Name: dispName.Name,
Description: descProp.Description, Description: desc.Description,
MaxResourceSize: maxResSize.Size, MaxResourceSize: maxResSize.Size,
}) })
} }

View File

@ -5,9 +5,9 @@ import (
"io" "io"
"mime" "mime"
"net/http" "net/http"
"net/url"
"os" "os"
"path" "path"
"net/url"
"github.com/emersion/go-webdav/internal" "github.com/emersion/go-webdav/internal"
) )