refactor(core): replace TakeOne usage with cmp.Or (#5461)

Co-authored-by: 1911860538 <alxps1911@gmail.com>
This commit is contained in:
Name
2026-03-22 10:50:16 +08:00
committed by GitHub
parent db3101361b
commit 8cd7f7a2d8
2 changed files with 4 additions and 3 deletions

View File

@@ -141,6 +141,7 @@ func Substr(str string, start, stop int) (string, error) {
}
// TakeOne returns valid string if not empty or later one.
// Deprecated: use cmp.Or instead.
func TakeOne(valid, or string) string {
if len(valid) > 0 {
return valid