Skip to content

Commit

Permalink
Fix compile error on Go < 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
garyburd committed Jan 19, 2017
1 parent 522f286 commit 2257eda
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion compression.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
6 changes: 2 additions & 4 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 2257eda

Please sign in to comment.