From 0a82c4aeaf6f603f065ed44904db4f0f90ea3925 Mon Sep 17 00:00:00 2001 From: Piyush Mishra Date: Mon, 28 Nov 2016 10:49:31 +0530 Subject: [PATCH] Stop shadowing the len function --- quicbench.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/quicbench.go b/quicbench.go index 35ab287..93cbf49 100644 --- a/quicbench.go +++ b/quicbench.go @@ -61,25 +61,25 @@ type MyConn struct { } func (this *MyConn) Read(b []byte) (n int, err error) { - len, err := this.Conn.Read(b) + n, err = this.Conn.Read(b) if err == nil { - this.result.readThroughput += int64(len) + this.result.readThroughput += int64(n) this.Conn.SetReadDeadline(time.Now().Add(this.readTimeout)) } - return len, err + return } func (this *MyConn) Write(b []byte) (n int, err error) { - len, err := this.Conn.Write(b) + n, err = this.Conn.Write(b) if err == nil { - this.result.writeThroughput += int64(len) + this.result.writeThroughput += int64(n) this.Conn.SetWriteDeadline(time.Now().Add(this.writeTimeout)) } - return len, err + return } func init() {