mirror of
https://github.com/samber/lo.git
synced 2026-04-22 23:47:11 +08:00
feat(lo.Try0): remove type definition
This commit is contained in:
@@ -9,6 +9,9 @@ Adding:
|
||||
- lo.Synchronize
|
||||
- lo.SumBy
|
||||
|
||||
Change:
|
||||
- Removed generic type definition for lo.Try0: `lo.Try0[T]()` -> `lo.Try0()`
|
||||
|
||||
## 1.19.0 (2022-04-30)
|
||||
|
||||
Adding:
|
||||
|
||||
@@ -79,7 +79,7 @@ func Try(callback func() error) (ok bool) {
|
||||
}
|
||||
|
||||
// Try0 has the same behavior than Try, but callback returns no variable.
|
||||
func Try0[T any](callback func()) bool {
|
||||
func Try0(callback func()) bool {
|
||||
return Try(func() error {
|
||||
callback()
|
||||
return nil
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ func TestAttemptWithDelay(t *testing.T) {
|
||||
is.Equal(err3, err)
|
||||
is.Equal(iter4, 11)
|
||||
is.Greater(dur4, 100*time.Millisecond)
|
||||
is.Less(dur4, 110*time.Millisecond)
|
||||
is.Less(dur4, 115*time.Millisecond)
|
||||
is.Equal(err4, nil)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user