mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-08-05 18:01:11 -05:00
Move mmss to api/utils.go
This commit is contained in:
parent
d1dd5816c2
commit
90f38dccca
17
api/main.go
17
api/main.go
|
|
@ -35,20 +35,3 @@ func StartServer(reload bool) {
|
|||
|
||||
func Shutdown() {
|
||||
}
|
||||
|
||||
// make map string string
|
||||
func mmss(data ...string) map[string]string {
|
||||
ret := make(map[string]string)
|
||||
|
||||
l := len(data)
|
||||
|
||||
if l%2 != 0 || l == 0 {
|
||||
panic("Length of data must be divisible by two")
|
||||
}
|
||||
|
||||
for i := 0; i < l; i += 2 {
|
||||
ret[data[i]] = data[i+1]
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
|
|
|||
18
api/utils.go
Normal file
18
api/utils.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package api
|
||||
|
||||
// make map string string
|
||||
func mmss(data ...string) map[string]string {
|
||||
ret := make(map[string]string)
|
||||
|
||||
l := len(data)
|
||||
|
||||
if l%2 != 0 || l == 0 {
|
||||
panic("Length of data must be divisible by two")
|
||||
}
|
||||
|
||||
for i := 0; i < l; i += 2 {
|
||||
ret[data[i]] = data[i+1]
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user