feat(crypt): customize filename_encoding (#5148)

close #5109
close #5080
This commit is contained in:
Sean
2023-09-03 18:06:44 +08:00
committed by GitHub
parent e7c0d94b44
commit 37dffd0fce
3 changed files with 17 additions and 10 deletions

View File

@ -30,3 +30,13 @@ func SafeAtob(data string) (string, error) {
}
return string(bytes), err
}
// GetNoneEmpty returns the first non-empty string, return empty if all empty
func GetNoneEmpty(strArr ...string) string {
for _, s := range strArr {
if len(s) > 0 {
return s
}
}
return ""
}