bbgo_origin/pkg/util/string.go

21 lines
333 B
Go
Raw Normal View History

2021-02-19 02:42:24 +00:00
package util
2021-12-22 17:16:08 +00:00
import "strings"
2021-02-19 02:42:24 +00:00
func StringSliceContains(slice []string, needle string) bool {
for _, s := range slice {
if s == needle {
return true
}
}
return false
}
2021-12-22 17:16:08 +00:00
func MaskKey(key string) string {
maskKey := key[0:5]
2021-12-29 07:25:31 +00:00
maskKey += strings.Repeat("*", len(key)-1-5-5)
maskKey += key[len(key)-5-1:]
return maskKey
2021-12-22 17:16:08 +00:00
}