github.com/jspc/eggos@v0.5.1-0.20221028160421-556c75c878a5/fs/dev.go (about)

     1  package fs
     2  
     3  import "math/rand"
     4  
     5  type zero struct{}
     6  
     7  func (z zero) Read(b []byte) (int, error) {
     8  	for i := range b {
     9  		b[i] = 0
    10  	}
    11  	return len(b), nil
    12  }
    13  
    14  type random struct{}
    15  
    16  func (r random) Read(b []byte) (int, error) {
    17  	return rand.Read(b)
    18  }