Move NullReader from nomad to util package.

This commit is contained in:
Konrad Hanff
2021-06-18 16:10:45 +02:00
parent 14f8a096eb
commit 6c887de6f1
4 changed files with 35 additions and 25 deletions

10
util/util.go Normal file
View File

@@ -0,0 +1,10 @@
package util
// NullReader is a struct that implements the io.Reader interface and returns nothing when reading
// from it.
type NullReader struct{}
func (r NullReader) Read(_ []byte) (int, error) {
// An empty select blocks forever.
select {}
}