You have 3 options.
- Try another library, perhaps one that uses cgo. I see two here.
- Use cgo directly/make your own lib.
- Use the xz executable.
Option three is easier than it sounds. Here is what I would use:
func xzReader(r io.Reader) io.ReadCloser {
rpipe, wpipe := io.Pipe()
cmd := exec.Command("xz", "--decompress", "--stdout")
cmd.Stdin = r
cmd.Stdout = wpipe
go func() {
err := cmd.Run()
wpipe.CloseWithError(err)
}()
return rpipe
}
Runnable code here: http://play.golang.org/p/SrgZiKdv9a