Skip to content
This repository was archived by the owner on Sep 3, 2021. It is now read-only.

Commit 0fed4ef

Browse files
CodeLingoTeamunknwon
authored andcommitted
Fix function comments based on best practices from Effective Go (#22)
Signed-off-by: CodeLingoBot <bot@codelingo.io>
1 parent 2d12a21 commit 0fed4ef

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

html.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func HtmlEncode(str string) string {
3636
return html.EscapeString(str)
3737
}
3838

39-
// decode string to html chars
39+
// HtmlDecode decodes string to html chars
4040
func HtmlDecode(str string) string {
4141
return html.UnescapeString(str)
4242
}

http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func FetchFiles(client *http.Client, files []RawFile, header http.Header) error
177177
return nil
178178
}
179179

180-
// FetchFiles uses command `curl` to fetch files specified by the rawURL field in parallel.
180+
// FetchFilesCurl uses command `curl` to fetch files specified by the rawURL field in parallel.
181181
func FetchFilesCurl(files []RawFile, curlOptions ...string) error {
182182
ch := make(chan error, len(files))
183183
for i := range files {

regex.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ func init() {
3737
regex_url = regexp.MustCompile(regex_url_pattern)
3838
}
3939

40-
// validate string is an email address, if not return false
40+
// IsEmail validates string is an email address, if not return false
4141
// basically validation can match 99% cases
4242
func IsEmail(email string) bool {
4343
return regex_email.MatchString(email)
4444
}
4545

46-
// validate string is an email address, if not return false
46+
// IsEmailRFC validates string is an email address, if not return false
4747
// this validation omits RFC 2822
4848
func IsEmailRFC(email string) bool {
4949
return regex_strict_email.MatchString(email)
5050
}
5151

52-
// validate string is a url link, if not return false
52+
// IsUrl validates string is a url link, if not return false
5353
// simple validation can match 99% cases
5454
func IsUrl(url string) bool {
5555
return regex_url.MatchString(url)

slice.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func CompareSliceStr(s1, s2 []string) bool {
4444
return true
4545
}
4646

47-
// CompareSliceStr compares two 'string' type slices.
47+
// CompareSliceStrU compares two 'string' type slices.
4848
// It returns true if elements are the same, and ignores the order.
4949
func CompareSliceStrU(s1, s2 []string) bool {
5050
if len(s1) != len(s2) {

0 commit comments

Comments
 (0)