mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 08:15:15 +00:00
21 lines
333 B
Go
21 lines
333 B
Go
package util
|
|
|
|
import "strings"
|
|
|
|
func StringSliceContains(slice []string, needle string) bool {
|
|
for _, s := range slice {
|
|
if s == needle {
|
|
return true
|
|
}
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
func MaskKey(key string) string {
|
|
maskKey := key[0:5]
|
|
maskKey += strings.Repeat("*", len(key)-1-5-5)
|
|
maskKey += key[len(key)-5-1:]
|
|
return maskKey
|
|
}
|