added golangci-linting, refactor, simplified error msgs and fixed some error handling

This commit is contained in:
yusing
2024-10-10 11:52:09 +08:00
parent d91b66ae87
commit da04a0dff4
63 changed files with 690 additions and 410 deletions

View File

@@ -9,7 +9,7 @@ import (
"golang.org/x/text/language"
)
// TODO: support other languages
// TODO: support other languages.
var titleCaser = cases.Title(language.AmericanEnglish)
func CommaSeperatedList(s string) []string {
@@ -31,3 +31,7 @@ func ExtractPort(fullURL string) (int, error) {
}
return strconv.Atoi(url.Port())
}
func PortString(port uint16) string {
return strconv.FormatUint(uint64(port), 10)
}