Skip to content

Commit

Permalink
Fix documentation of NewPool
Browse files Browse the repository at this point in the history
  • Loading branch information
Jille authored and jackc committed Jan 28, 2024
1 parent 825ae07 commit 182cc3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ type Config[T any] struct {
MaxSize int32
}

// NewPool creates a new pool. Panics if maxSize is less than 1.
// NewPool creates a new pool. Returns an error iff MaxSize is less than 1.
func NewPool[T any](config *Config[T]) (*Pool[T], error) {
if config.MaxSize < 1 {
return nil, errors.New("MaxSize must be >= 1")
Expand Down

0 comments on commit 182cc3d

Please sign in to comment.