mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-10 08:29:58 +08:00
refactor(core): replace TakeOne usage with cmp.Or (#5461)
Co-authored-by: 1911860538 <alxps1911@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user