2020-09-16 14:19:51 +00:00
|
|
|
// Copyright 2020 the Pinniped contributors. All Rights Reserved.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
2020-08-06 22:19:09 +00:00
|
|
|
|
|
|
|
package testutil
|
|
|
|
|
|
|
|
import "io"
|
|
|
|
|
|
|
|
// ErrorWriter implements io.Writer by returning a fixed error.
|
|
|
|
type ErrorWriter struct {
|
|
|
|
ReturnError error
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ io.Writer = &ErrorWriter{}
|
|
|
|
|
|
|
|
func (e *ErrorWriter) Write([]byte) (int, error) { return 0, e.ReturnError }
|