Files
go-openai/internal/test/failer.go
渡邉祐一 / Yuichi Watanabe 1394329e44 move error_accumulator into internal pkg (#304) (#335)
* move error_accumulator into internal pkg (#304)

* move error_accumulator into internal pkg (#304)

* add a test for ErrTooManyEmptyStreamMessages in stream_reader (#304)
2023-06-05 18:35:46 +04:00

22 lines
390 B
Go

package test
import "errors"
var (
ErrTestErrorAccumulatorWriteFailed = errors.New("test error accumulator failed")
)
type FailingErrorBuffer struct{}
func (b *FailingErrorBuffer) Write(_ []byte) (n int, err error) {
return 0, ErrTestErrorAccumulatorWriteFailed
}
func (b *FailingErrorBuffer) Len() int {
return 0
}
func (b *FailingErrorBuffer) Bytes() []byte {
return []byte{}
}