Go compress/flate: the DEFLATE compressed data format
Answer: Package flate implements the DEFLATE compressed data format.
Compression levels
The format is described in RFC 1951.
BestSpeed is 1.
BestCompression is 9.
DefaultCompression is -1.
HuffmanOnly disables Lempel-Ziv match searching.
It only performs Huffman entropy encoding.
A preset dictionary can be used to improve the compression ratio.
Related packages
The compress/gzip and compress/zlib packages implement access to DEFLATE-based file formats.
See also
Claims
- id: C1 claim: The package implements the DEFLATE compressed data format in RFC 1951. source: S1 evidence: "Package flate implements the DEFLATE compressed data format"
- id: C2 claim: The gzip and zlib packages implement access to DEFLATE-based file formats. source: S1 evidence: "packages implement access to DEFLATE-based file formats"
- id: C3 claim: BestCompression is 9. source: S1 evidence: "BestCompression = 9"
- id: C4 claim: HuffmanOnly disables Lempel-Ziv match searching. source: S2 evidence: "HuffmanOnly disables Lempel-Ziv match searching"
Sources
- [S1] compress/flate package reference. Go. https://pkg.go.dev/compress/flate . License: BSD-3-Clause. Accessed 2026-11-24.
- [S2] compress/flate source. Go. https://go.dev/src/compress/flate/deflate.go . License: BSD-3-Clause. Accessed 2026-11-24.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Go, compress/flate package reference; Go, compress/flate source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Go, compress/flate package reference; Go, compress/flate source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors.
Cite this
iinventedlight. 2026. "Go compress/flate: the DEFLATE compressed data format." iinventedlight Library, iil:note:84q55yxm, version of 2026-11-24. https://iinventedlight.com/library/notes/go-compress-flate/. License: CC-BY-4.0.
@misc{iil_note_84q55yxm,
author = {{iinventedlight}},
title = {{Go compress/flate: the DEFLATE compressed data format}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-24},
url = {https://iinventedlight.com/library/notes/go-compress-flate/},
note = {Permanent ID iil:note:84q55yxm. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- go-compress-flate.schema.json (schema; CC-BY-4.0)
- go-compress-flate.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/go-compress-flate.md.