皈依舞
Go 标准库中没有 Lempel-Ziv-Markow 编码器或解码器。如果允许您假设运行代码的平台提供了该xz实用程序,则可以使用如下存根函数:import "os/exec"// decompress xz compressed data stream r.func UnxzReader(r io.Reader) (io.ReadCloser, error) { unxz := exec.Command("xz", "-d") unxz.Stdin = r out, err := unxz.StdoutPipe() if err != nil { return nil, err } err = unxz.Start() if err != nil { return nil, err } // we are not interested in the exit status, but we should really collect // that zombie process go unxz.Wait() return out, nil}