Restructure project
We previously didn't really had any structure in our project apart from creating a new folder for each package in our project root. Now that we have accumulated some packages, we use the well-known Golang project layout in order to clearly communicate our intent with packages. See https://github.com/golang-standards/project-layout
This commit is contained in:
10
pkg/nullreader/nullreader.go
Normal file
10
pkg/nullreader/nullreader.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package nullreader
|
||||
|
||||
// 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