Commit e63d2463 authored by JessonChan's avatar JessonChan

go test fixed

parent 499e2b59
...@@ -4,6 +4,7 @@ import ( ...@@ -4,6 +4,7 @@ import (
"bytes" "bytes"
"compress/flate" "compress/flate"
"compress/gzip" "compress/gzip"
"compress/zlib"
"io" "io"
"io/ioutil" "io/ioutil"
"os" "os"
...@@ -43,7 +44,7 @@ func TestOpenStaticFileGzip_1(t *testing.T) { ...@@ -43,7 +44,7 @@ func TestOpenStaticFileGzip_1(t *testing.T) {
func TestOpenStaticFileDeflate_1(t *testing.T) { func TestOpenStaticFileDeflate_1(t *testing.T) {
file, _ := os.Open(licenseFile) file, _ := os.Open(licenseFile)
var zipBuf bytes.Buffer var zipBuf bytes.Buffer
fileWriter, _ := flate.NewWriter(&zipBuf, flate.BestCompression) fileWriter, _ := zlib.NewWriterLevel(&zipBuf, flate.BestCompression)
io.Copy(fileWriter, file) io.Copy(fileWriter, file)
fileWriter.Close() fileWriter.Close()
content, _ := ioutil.ReadAll(&zipBuf) content, _ := ioutil.ReadAll(&zipBuf)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment