Skip to content

Commit 2257eda

Browse files
committed
Fix compile error on Go < 1.6
1 parent 522f286 commit 2257eda

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

compression.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
)
1414

1515
const (
16-
minCompressionLevel = -2 // flate.HuffmanOnly
16+
minCompressionLevel = -2 // flate.HuffmanOnly not defined in Go < 1.6
1717
maxCompressionLevel = flate.BestCompression
1818
defaultCompressionLevel = 1
1919
)

conn.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,10 +1065,8 @@ func (c *Conn) EnableWriteCompression(enable bool) {
10651065

10661066
// SetCompressionLevel sets the flate compression level for subsequent text and
10671067
// binary messages. This function is a noop if compression was not negotiated
1068-
// with the peer. Valid levels range from -2 to 9. Level -1 uses the default
1069-
// compression level. Level -2 uses Huffman compression only, Level 0 does not
1070-
// attempt any compression. Levels 1 through 9 range from best speed to best
1071-
// compression.
1068+
// with the peer. See the compress/flate package for a description of
1069+
// compression levels.
10721070
func (c *Conn) SetCompressionLevel(level int) error {
10731071
if !isValidCompressionLevel(level) {
10741072
return errors.New("websocket: invalid compression level")

0 commit comments

Comments
 (0)