mirror of https://github.com/usememos/memos
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
363 B
Go
22 lines
363 B
Go
3 years ago
|
package common
|
||
|
|
||
|
import (
|
||
|
"strings"
|
||
|
|
||
|
"github.com/google/uuid"
|
||
|
)
|
||
|
|
||
|
// HasPrefixes returns true if the string s has any of the given prefixes.
|
||
|
func HasPrefixes(src string, prefixes ...string) bool {
|
||
|
for _, prefix := range prefixes {
|
||
|
if strings.HasPrefix(src, prefix) {
|
||
|
return true
|
||
|
}
|
||
|
}
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
func GenUUID() string {
|
||
|
return uuid.New().String()
|
||
|
}
|