Skip to content

Commit

Permalink
fix safe assert
Browse files Browse the repository at this point in the history
  • Loading branch information
hyphennn committed Jan 15, 2025
1 parent 12ee7b8 commit 384210d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gvalue/gvalue.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ func Zero[T any]() (t T) {
}

func SafeAssert[T any](v any) T {
v, ok := v.(T)
vv, ok := v.(T)
if !ok {
return Zero[T]()
}
return v
return vv
}

0 comments on commit 384210d

Please sign in to comment.