Skip to content

Commit 824aa71

Browse files
chore: change the comment on NewReader to make it explicit the function can panic
1 parent 3f68080 commit 824aa71

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

reader.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,9 @@ type readerStats struct {
626626

627627
// NewReader creates and returns a new Reader configured with config.
628628
// The offset is initialized to FirstOffset.
629+
//
630+
// This function will panic if the [ReaderConfig] argument is invalid.
631+
// Consider calling [ReaderConfig.Validate] before to make sure your config is valid.
629632
func NewReader(config ReaderConfig) *Reader {
630633
if err := config.Validate(); err != nil {
631634
panic(err)

0 commit comments

Comments
 (0)