config: add ListKeys
This commit is contained in:
parent
fb11c0c27c
commit
34982c122f
|
@ -13,6 +13,7 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"git.wntrmute.dev/kyle/goutils/config/iniconf"
|
||||
|
@ -139,3 +140,14 @@ func Require(key string) string {
|
|||
|
||||
return v
|
||||
}
|
||||
|
||||
// ListKeys returns a slice of the currently known keys.
|
||||
func ListKeys() []string {
|
||||
keyList := []string{}
|
||||
for k := range vars {
|
||||
keyList = append(keyList, k)
|
||||
}
|
||||
|
||||
sort.Strings(keyList)
|
||||
return keyList
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue