Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. xz

xz

NOASSERTIONGo

Pure Go package for reading and writing xz-compressed files with a command-line tool included.

GitHubGitHub
559 stars53 forks0 contributors

What is xz?

Package xz is a pure Go implementation for reading and writing xz-compressed files and streams. It provides both a library API for programmatic compression/decompression within Go applications and a command-line tool called gxz for file operations. The package solves the need for xz compression capabilities in Go environments without relying on external C libraries or tools.

Target Audience

Go developers who need to integrate xz compression or decompression into their applications, tools, or build processes, particularly those prioritizing security and dependency management.

Value Proposition

Developers choose this package because it's written entirely in Go with no C dependencies, making it easier to build, deploy, and secure compared to binding to the original xz C library. It also provides immunity to certain supply-chain vulnerabilities affecting the original implementation.

Overview

Pure golang package for reading and writing xz-compressed files

Use Cases

Best For

  • Adding xz compression to Go applications without C dependencies
  • Building Go tools that require xz file support
  • Creating secure compression pipelines immune to CVE-2024-3094
  • Compressing/decompressing files from Go command-line utilities
  • Processing xz streams within Go web services or APIs
  • Educational purposes for understanding xz compression in Go

Not Ideal For

  • Production systems requiring stable APIs for long-term maintenance
  • High-performance applications where compression speed is critical
  • Environments demanding maximum compression efficiency comparable to xz-utils

Pros & Cons

Pros

Pure Go Implementation

Written entirely in Go with no C dependencies, making it easy to build and deploy in Go environments without external library hassles, as highlighted in the README.

Security-Focused Design

Not affected by CVE-2024-3094 and enforces strict security review policies for patches, providing a safer alternative to C-based xz utilities.

Integrated CLI Tool

Includes the gxz command-line utility for compressing and decompressing files directly from the terminal, adding convenience for Go developers.

Clean Streaming API

Offers a straightforward API for reading and writing xz streams, as demonstrated in the example code, facilitating easy integration into Go applications.

Cons

Unstable APIs

APIs are not considered stable, as stated in the README, meaning breaking changes could occur, which is risky for production code.

Performance Trade-Offs

Cannot compete with the original xz tool regarding compression speed and size, as admitted in the README, due to its early development stage and lack of optimizations.

Early Development Bugs

Being under development, there might be undiscovered bugs, and the package is less mature compared to established alternatives like xz-utils.

Frequently Asked Questions

Quick Stats

Stars559
Forks53
Contributors0
Open Issues17
Last commit4 days ago
CreatedSince 2014

Tags

#pure-go#stream-compression#cli-tool#golang-library#data-compression#file-compression#decompression#go#compression

Built With

G
Go

Included in

Go169.1k
Auto-fetched 16 hours ago

Related Projects

gopsutilgopsutil

psutil for golang

Stars11,882
Forks1,678
Last commit2 days ago
gatusgatus

Automated developer-oriented status page with alerting and incident support

Stars11,595
Forks774
Last commit5 days ago
gofakeitgofakeit

Random fake data generator written in go

Stars5,372
Forks297
Last commit2 months ago
puregopurego

A library for calling C functions from Go without Cgo

Stars3,746
Forks118
Last commit4 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub