diff options
Diffstat (limited to 'helpers/baseURL.go')
-rw-r--r-- | helpers/baseURL.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/helpers/baseURL.go b/helpers/baseURL.go index 5ea82b26d..eb39ced5b 100644 --- a/helpers/baseURL.go +++ b/helpers/baseURL.go @@ -30,7 +30,8 @@ func (b BaseURL) String() string { return b.urlStr } -// Protocol is normally on the form "scheme://", i.e. "webcal://". +// WithProtocol returns the BaseURL prefixed with the given protocol. +// The Protocol is normally of the form "scheme://", i.e. "webcal://". func (b BaseURL) WithProtocol(protocol string) (string, error) { u := b.URL() @@ -55,8 +56,9 @@ func (b BaseURL) WithProtocol(protocol string) (string, error) { return u.String(), nil } +// URL returns a copy of the internal URL. +// The copy can be safely used and modified. func (b BaseURL) URL() *url.URL { - // create a copy as it will be modified. c := *b.url return &c } |