Skip to content

Commit

Permalink
Fix doc comments, simplify discover return
Browse files Browse the repository at this point in the history
  • Loading branch information
dpeukert committed Oct 13, 2020
1 parent ec9206a commit 96034fb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions caldav/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ import (
"github.com/emersion/go-webdav/internal"
)

// Discover performs a DNS-based CalDAV service discovery as described in
// RFC 6764 section 6. It returns the URL to the CalDAV server.
func Discover(host string) (string, error) {
url, err := internal.Discover("caldav", host)
return url, err
return internal.Discover("caldav", host)
}

// Client provides access to a remote CalDAV server.
Expand Down
5 changes: 3 additions & 2 deletions carddav/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ import (
"github.com/emersion/go-webdav/internal"
)

// Discover performs a DNS-based CardDAV service discovery as described in
// RFC 6764 section 6. It returns the URL to the CardDAV server.
func Discover(host string) (string, error) {
url, err := internal.Discover("carddav", host)
return url, err
return internal.Discover("carddav", host)
}

// Client provides access to a remote CardDAV server.
Expand Down
4 changes: 2 additions & 2 deletions internal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"unicode"
)

// Discover performs a DNS-based CalDAV/CardDAV service discovery as described in
// RFC 6764 section 6. It returns the URL to the CalDAV/CardDAV server.
// Discover performs a DNS-based CalDAV/CardDAV service discovery as described
// in RFC 6764 section 6. It returns the URL to the CalDAV/CardDAV server.
func Discover(service string, host string) (string, error) {
if service != "caldav" && service != "carddav" {
return "", fmt.Errorf("webdav: service discovery of type %v not supported", service)
Expand Down

0 comments on commit 96034fb

Please sign in to comment.