model function unit tests!
This commit is contained in:
parent
e5ae167550
commit
6db35b2f99
9 changed files with 254 additions and 16 deletions
|
@ -11,6 +11,6 @@ type Link struct {
|
|||
}
|
||||
|
||||
func (link Link) NormaliseName() string {
|
||||
rgx := regexp.MustCompile(`[^a-z0-9]`)
|
||||
return strings.ToLower(rgx.ReplaceAllString(link.Name, ""))
|
||||
rgx := regexp.MustCompile(`[^a-z0-9\-]`)
|
||||
return rgx.ReplaceAllString(strings.ToLower(link.Name), "")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue