Move NullReader from nomad to util package.
This commit is contained in:
10
util/util.go
Normal file
10
util/util.go
Normal 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 {}
|
||||
}
|
Reference in New Issue
Block a user