mirror of
https://github.com/unti-io/go-utils.git
synced 2025-10-30 11:06:22 +08:00
v1.3.0
This commit is contained in:
@@ -26,7 +26,7 @@ func Ternary[T any](IF bool, TRUE T, FALSE T) T {
|
||||
|
||||
// Default - 设置默认值
|
||||
func Default[T any](param T, value ...T) (result T) {
|
||||
if IsEmpty(param) {
|
||||
if Is.Empty(param) {
|
||||
if len(value) > 0 {
|
||||
return value[0]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user