Add some missing doc comments

As pointed out by the linter, some exported functions and types are
missing doc comments.
The linter warnings have been reduced from 194 to 116.
Not all missing comments have been added in this commit though.
This commit is contained in:
Jorin Vogel 2017-08-02 14:25:05 +02:00 committed by Bjørn Erik Pedersen
parent 9891c0fb0e
commit 81c13171a9
30 changed files with 109 additions and 23 deletions

View file

@ -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
}