test
This commit is contained in:
parent
7e5c85837f
commit
1f0758e683
14
msg.go
14
msg.go
@ -340,9 +340,19 @@ func UnzipMessages(z []byte) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
bkp := DataBackup{}
|
||||
err = json.NewDecoder(rc).Decode(bkp)
|
||||
data, err := ioutil.ReadAll(rc)
|
||||
logOnError(err, "UnzipMessages : ReadAll")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Printf("UnzipMessages : %d uncompressed bytes.\n", len(data))
|
||||
rc.Close()
|
||||
bkp := DataBackup{}
|
||||
err = json.Unmarshal(data, &bkp)
|
||||
logOnError(err, "UnzipMessages : Unmarshal")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Printf("UnzipMessages : %d messages.\n", len(bkp.Messages))
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user