mirror of
https://github.com/go-gitea/gitea
synced 2024-09-20 16:18:57 +02:00
b6a95a8cb3
* Dropped unused codekit config * Integrated dynamic and static bindata for public * Ignore public bindata * Add a general generate make task * Integrated flexible public assets into web command * Updated vendoring, added all missiong govendor deps * Made the linter happy with the bindata and dynamic code * Moved public bindata definition to modules directory * Ignoring the new bindata path now * Updated to the new public modules import path * Updated public bindata command and drop the new prefix
19 lines
324 B
Go
19 lines
324 B
Go
package etcd
|
|
|
|
import (
|
|
"math/rand"
|
|
)
|
|
|
|
func shuffleStringSlice(cards []string) []string {
|
|
size := len(cards)
|
|
//Do not need to copy if nothing changed
|
|
if size <= 1 {
|
|
return cards
|
|
}
|
|
shuffled := make([]string, size)
|
|
index := rand.Perm(size)
|
|
for i := range cards {
|
|
shuffled[index[i]] = cards[i]
|
|
}
|
|
return shuffled
|
|
}
|