From 2257eda00b2084c1351cd672aa5476daa9f5e463 Mon Sep 17 00:00:00 2001 From: Gary Burd Date: Thu, 19 Jan 2017 11:27:08 -0800 Subject: [PATCH] Fix compile error on Go < 1.6 --- compression.go | 2 +- conn.go | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/compression.go b/compression.go index a46c2b7..49a243b 100644 --- a/compression.go +++ b/compression.go @@ -13,7 +13,7 @@ import ( ) const ( - minCompressionLevel = -2 // flate.HuffmanOnly + minCompressionLevel = -2 // flate.HuffmanOnly not defined in Go < 1.6 maxCompressionLevel = flate.BestCompression defaultCompressionLevel = 1 ) diff --git a/conn.go b/conn.go index 5a6f65d..c8aee1c 100644 --- a/conn.go +++ b/conn.go @@ -1065,10 +1065,8 @@ func (c *Conn) EnableWriteCompression(enable bool) { // SetCompressionLevel sets the flate compression level for subsequent text and // binary messages. This function is a noop if compression was not negotiated -// with the peer. Valid levels range from -2 to 9. Level -1 uses the default -// compression level. Level -2 uses Huffman compression only, Level 0 does not -// attempt any compression. Levels 1 through 9 range from best speed to best -// compression. +// with the peer. See the compress/flate package for a description of +// compression levels. func (c *Conn) SetCompressionLevel(level int) error { if !isValidCompressionLevel(level) { return errors.New("websocket: invalid compression level")