Skip to content

Commit

Permalink
feat: add EmptyStream
Browse files Browse the repository at this point in the history
  • Loading branch information
sharpvik committed Oct 8, 2024
1 parent 45c42f1 commit 0539ba7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions errstream.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
package fungi

import "io"

func ErrorStream[T any](err error) Stream[T] {
return &errorStream[T]{err}
}

func EmptyStream[T any]() Stream[T] {
return ErrorStream[T](io.EOF)
}

type errorStream[T any] struct {
err error
}
Expand Down

0 comments on commit 0539ba7

Please sign in to comment.