Skip to content

Commit

Permalink
added comment for the newly exposed function CanonicalDialect
Browse files Browse the repository at this point in the history
  • Loading branch information
sio4 committed Jun 30, 2022
1 parent a4549f0 commit 4f498f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pop.go
Expand Up @@ -56,6 +56,12 @@ func DialectSupported(d string) bool {
return false
}

// CanonicalDialect checks if the given synonym (could be a valid dialect too)
// is a registered synonym and returns the canonical dialect for the synonym.
// Otherwise, it returns the lowercase value of the given synonym.
//
// Note that it does not check if the return value is a valid (supported)
// dialect so you need to check it with `DialectSupported()`.
func CanonicalDialect(synonym string) string {
d := strings.ToLower(synonym)
if syn, ok := dialectSynonyms[d]; ok {
Expand Down

0 comments on commit 4f498f4

Please sign in to comment.