feat: initial goget release — modern IPv6-first download utility

This commit is contained in:
2026-06-26 21:21:58 +02:00
commit 53db81e1f7
147 changed files with 45931 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
//go:build linux || freebsd
// +build linux freebsd
package compression
import (
"compress/lzw"
"io"
)
const lzwLitWidth = 8
type lzwDecompressor struct {
*BaseDecompressor
order lzw.Order
}
func NewLzwDecompressor() *lzwDecompressor { return NewLzwDecompressorWithOrder(lzw.LSB) }
func NewLzwDecompressorWithOrder(order lzw.Order) *lzwDecompressor {
name := "lzw"
if order == lzw.MSB {
name = "lzw-msb"
}
return &lzwDecompressor{NewBaseDecompressor(name, []string{}, []string{".z", ".lzw"}), order}
}
func (l *lzwDecompressor) Reader(r io.Reader) (io.ReadCloser, error) {
return lzw.NewReader(r, l.order, lzwLitWidth), nil
}
type lzwCompressor struct {
name string
order lzw.Order
}
func NewLzwCompressor() *lzwCompressor { return NewLzwCompressorWithOrder(lzw.LSB) }
func NewLzwCompressorWithOrder(order lzw.Order) *lzwCompressor {
name := "lzw"
if order == lzw.MSB {
name = "lzw-msb"
}
return &lzwCompressor{name: name, order: order}
}
func (l *lzwCompressor) Name() string { return l.name }
func (l *lzwCompressor) Writer(w io.Writer) (io.WriteCloser, error) {
return lzw.NewWriter(w, l.order, lzwLitWidth), nil
}
func init() { Register(NewLzwDecompressor()) }