Make slice on creation

This commit is contained in:
Till Faelligen 2021-06-18 22:12:21 +02:00
parent 0d3a6e1c37
commit 63bba0661f

View file

@ -41,11 +41,10 @@ var allowedPresence = map[string]bool{
"offline": true,
"unavailable": true,
}
var allowedStrings []string
var allowedStrings = make([]string, len(allowedPresence))
// we only need to do this once
func init() {
allowedStrings = make([]string, len(allowedPresence))
i := 0
for k := range allowedPresence {
allowedStrings[i] = k