You've already forked gitea-mirror
mirror of
https://github.com/bryanpedini/gitea-mirror.git
synced 2025-10-13 12:04:14 +00:00
added StringSliceToMap util, performed github migration only on request
This commit is contained in:
13
utils/sliceToMap.go
Normal file
13
utils/sliceToMap.go
Normal file
@@ -0,0 +1,13 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user