1
0
Fork 0
mirror of https://github.com/avelino/awesome-go.git synced 2024-11-13 11:14:37 -05:00
This commit is contained in:
Kirill Zhuravlev 2023-02-14 21:26:37 +01:00 committed by Avelino
parent e318f94283
commit b750341e0d
No known key found for this signature in database
GPG key ID: B345B4D52E98180A
2 changed files with 2 additions and 0 deletions

View file

@ -122,6 +122,7 @@ func mkdirAll(path string) error {
}
// NOTE: directory is not exists
// FIXME: fix rights
if err := os.MkdirAll(path, 0o755); err != nil {
return err
}

View file

@ -8,6 +8,7 @@ import (
// Generate slugs similar to GitHub's slugs on markdown parsing
func Generate(text string) string {
// FIXME: this is should be like regexp.Replace(`[^-a-zA-Z\d]+`, ``)
s := strings.ReplaceAll(text, "/", "")
return slugify.Slugify(strings.TrimSpace(s))
}