Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Ce dépôt a été archivé le 2022-05-07. Vous pouvez voir ses fichiers ou le cloner, mais pas ouvrir de ticket ou de demandes d'ajout, ni soumettre de changements.
nyaa-pantsu/util/unzlib.go
akuma06 823901b8ab Rearranged Files
Configurations are separated in files in the folder config
Connection to database by a package to import when needed
Models will be in a model package for better maintenance
Services access to the models
Utils are tools or functions that can be used anywhere
main.go cleaned a bit and other files modifications are there for the above modifications
2017-05-05 14:20:51 +02:00

22 lignes
Pas d'EOL
360 o
Go

package util
import (
"github.com/ewhal/nyaa/util/log"
"bytes"
"compress/zlib"
"io/ioutil"
)
func UnZlib(description []byte) string {
if len(description) > 0 {
b := bytes.NewReader(description)
z, err := zlib.NewReader(b)
log.CheckError(err)
defer z.Close()
p, err := ioutil.ReadAll(z)
log.CheckError(err)
return string(p)
}
return ""
}