From 3ca13bcd9e193a191a7463bf3f23a0c81305a918 Mon Sep 17 00:00:00 2001 From: Soheil Hassas Yeganeh Date: Sun, 21 Feb 2016 10:37:29 -0500 Subject: [PATCH] Remove the unncessary var and const blocks --- cmux.go | 8 +++----- matchers.go | 8 ++------ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/cmux.go b/cmux.go index 1143453..f9e6907 100644 --- a/cmux.go +++ b/cmux.go @@ -38,11 +38,9 @@ func (e errListenerClosed) Error() string { return string(e) } func (e errListenerClosed) Temporary() bool { return false } func (e errListenerClosed) Timeout() bool { return false } -var ( - // ErrListenerClosed is returned from muxListener.Accept when the underlying - // listener is closed. - ErrListenerClosed = errListenerClosed("mux: listener closed") -) +// ErrListenerClosed is returned from muxListener.Accept when the underlying +// listener is closed. +var ErrListenerClosed = errListenerClosed("mux: listener closed") // New instantiates a new connection multiplexer. func New(l net.Listener) CMux { diff --git a/matchers.go b/matchers.go index 93913f1..987b6dc 100644 --- a/matchers.go +++ b/matchers.go @@ -46,9 +46,7 @@ func HTTP1Fast(extMethods ...string) Matcher { return PrefixMatcher(append(defaultHTTPMethods, extMethods...)...) } -const ( - maxHTTPRead = 4096 -) +const maxHTTPRead = 4096 // HTTP1 parses the first line or upto 4096 bytes of the request to see if // the conection contains an HTTP request. @@ -81,9 +79,7 @@ func parseRequestLine(line string) (method, uri, proto string, ok bool) { return line[:s1], line[s1+1 : s2], line[s2+1:], true } -var ( - http2Preface = []byte(http2.ClientPreface) -) +var http2Preface = []byte(http2.ClientPreface) // HTTP2 parses the frame header of the first frame to detect whether the // connection is an HTTP2 connection.