blob: 5609404a816b71c3d0d419589cfa5935d3b6099a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
package utils
import (
"soko/pkg/utils"
"strings"
)
// FormatRestricts returns a string containing a comma separated
// list of capitalized first letters of the package restricts
func FormatRestricts(restricts []string) string {
var result []string
for _, restrict := range restricts {
if restrict != "" && restrict != "(" && restrict != ")" && !strings.HasSuffix(restrict, "?") {
result = append(result, strings.ToUpper(string(restrict[0])))
}
}
result = utils.Deduplicate(result)
return strings.Join(result, ", ")
}
|