rpc/dataconn: microbenchmark

This commit is contained in:
Christian Schwarz
2018-12-23 13:45:35 +01:00
parent 796c5ad42d
commit 0230c6321f
3 changed files with 118 additions and 46 deletions

14
util/devnoop/devnoop.go Normal file
View File

@ -0,0 +1,14 @@
// package devnoop provides an io.ReadWriteCloser that never errors
// and always reports reads / writes to / from buffers as complete.
// The buffers themselves are never touched.
package devnoop
type Dev struct{}
func Get() Dev {
return Dev{}
}
func (Dev) Write(p []byte) (n int, err error) { return len(p), nil }
func (Dev) Read(p []byte) (n int, err error) { return len(p), nil }
func (Dev) Close() error { return nil }