Package xz implements XZ decompression natively in Go.
Documentation at https://pkg.go.dev/github.com/therootcompany/xz.
Download and install with go get github.com/xi2/xz
.
If you need compression as well as decompression, you might want to look at https://github.com/ulikunitz/xz.
This was originally released into the public domain by the AUTHORS.
Here it is licensed more explicitly as Creative Commons CC0 1.0 Universal (CC0-1.0) so that it can be detected by automated tooling, and satisfy the legal requirements for vendor integration for cases in which a "public domain" statement is not sufficient.