From f5b779fb9ff543362aae27af4d970d4b64e711cc Mon Sep 17 00:00:00 2001 From: Mikkel Kamstrup Erlandsen Date: Fri, 2 Jun 2023 12:24:04 +0200 Subject: [PATCH] fix error handling example in docs --- doc/error.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/error.md b/doc/error.md index f464f21..e540ab9 100644 --- a/doc/error.md +++ b/doc/error.md @@ -44,7 +44,9 @@ func downloadFile(name string) error { } func downloadAllFiles() error { - firstErr, _ := seq.MappingOf(filesToDownload.Seq(), downloadFile).First(1) - return firstErr.Or(nil) + firstErr, _ := seq.MappingOf(filesToDownload.Seq(), downloadFile). + Where(seq.IsNonZero[error]). + First() + return firstErr.Or(nil) } ``` \ No newline at end of file