repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
50e484e
parent
5154fa9
author
Eric Bower
date
2023-03-15 03:39:28 +0000 UTC
chore: fix lint errors
1 files changed,  +4, -10
M shared/mdparser.go
+4, -10
 1@@ -110,20 +110,14 @@ func toAliases(obj interface{}) ([]string, error) {
 2 	switch raw := obj.(type) {
 3 	case []interface{}:
 4 		for _, alias := range raw {
 5-			als := alias.(string)
 6-			if strings.HasPrefix(als, "/") {
 7-				als = als[1:]
 8-			}
 9-			arr = append(arr, strings.TrimSpace(als))
10+			als := strings.TrimSpace(alias.(string))
11+			arr = append(arr, strings.TrimPrefix(als, "/"))
12 		}
13 	case string:
14 		aliases := strings.Split(raw, " ")
15 		for _, alias := range aliases {
16-			als := alias
17-			if strings.HasPrefix(als, "/") {
18-				als = als[1:]
19-			}
20-			arr = append(arr, strings.TrimSpace(als))
21+			als := strings.TrimSpace(alias)
22+			arr = append(arr, strings.TrimPrefix(als, "/"))
23 		}
24 	default:
25 		return arr, fmt.Errorf("unsupported type for `aliases` variable: %T", raw)