0
0
mirror of https://github.com/bryanpedini/gitea-mirror.git synced 2024-11-22 22:12:24 +00:00
gitea-mirror/utils/sliceToMap.go

14 lines
318 B
Go
Raw Normal View History

package utils
// StringSliceToMap Converts a slice of strings into a map formed by
// keys equals to the slice values, and empty strings as map values.
func StringSliceToMap(slice []string) map[string]string {
ret := make(map[string]string)
for i := 0; i < len(slice); i++ {
ret[slice[i]] = ""
}
return ret
}