mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 09:10:55 +00:00
go test fixed
This commit is contained in:
parent
499e2b59e4
commit
e63d24637d
@ -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) {
|
|||||||
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user