Skip to content

Commit 248fb6c

Browse files
committed
refactor: drop writer and all unused code
Signed-off-by: Christian Stewart <christian@aperture.us>
1 parent 17e5901 commit 248fb6c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1556
-127664
lines changed

.golangci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
linters:
2+
enable:
3+
- depguard
4+
- goimports
5+
- gosec
6+
- gosimple
7+
- govet
8+
- importas
9+
# - ineffassign
10+
- misspell
11+
- revive
12+
- staticcheck
13+
- typecheck
14+
# - unconvert
15+
- unused
16+
17+
disable:
18+
- errcheck
19+
20+
run:
21+
concurrency: 4
22+
modules-download-mode: vendor
23+
24+
skip-dirs:
25+
- hack
26+
27+
linters-settings:
28+
staticcheck:
29+
checks:
30+
- all
31+
- '-SA1012' # Allow passing nil contexts.
32+
33+
importas:
34+
# Do not allow unaliased imports of aliased packages.
35+
no-unaliased: true
36+
37+
maligned:
38+
suggest-new: true
39+
40+
depguard:
41+
rules:
42+
main:
43+
deny:
44+
- pkg: io/ioutil
45+
desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil
46+
- pkg: "github.com/stretchr/testify/assert"
47+
desc: Use "gotest.tools/v3/assert" instead
48+
- pkg: "github.com/stretchr/testify/require"
49+
desc: Use "gotest.tools/v3/assert" instead
50+
- pkg: "github.com/stretchr/testify/suite"
51+
desc: Do not use
52+
53+
revive:
54+
rules:
55+
- name: package-comments
56+
disabled: true
57+
58+
issues:
59+
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
60+
max-issues-per-linter: 0
61+
62+
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
63+
max-same-issues: 0
64+
65+
exclude:
66+
- G601

Makefile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
SHELL:=bash
2+
GOIMPORTS=hack/bin/goimports
3+
GOFUMPT=hack/bin/gofumpt
4+
GOLANGCI_LINT=hack/bin/golangci-lint
5+
GOLIST=go list -f "{{ .Dir }}" -m
6+
7+
export GO111MODULE=on
8+
undefine GOOS
9+
undefine GOARCH
10+
11+
all:
12+
13+
vendor:
14+
go mod vendor
15+
16+
$(GOIMPORTS):
17+
cd ./hack; \
18+
go build -v \
19+
-o ./bin/goimports \
20+
golang.org/x/tools/cmd/goimports
21+
22+
$(GOFUMPT):
23+
cd ./hack; \
24+
go build -v \
25+
-o ./bin/gofumpt \
26+
mvdan.cc/gofumpt
27+
28+
$(GOLANGCI_LINT):
29+
cd ./hack; \
30+
go build -v \
31+
-o ./bin/golangci-lint \
32+
github.com/golangci/golangci-lint/cmd/golangci-lint
33+
34+
.PHONY: lint
35+
lint: $(GOLANGCI_LINT)
36+
$(GOLANGCI_LINT) run --timeout=10m
37+
38+
.PHONY: fix
39+
fix: $(GOLANGCI_LINT)
40+
$(GOLANGCI_LINT) run --fix --timeout=10m
41+
42+
.PHONY: format
43+
format: $(GOFUMPT) $(GOIMPORTS)
44+
$(GOIMPORTS) -w ./
45+
$(GOFUMPT) -w ./
46+
47+
.PHONY: test
48+
test:
49+
go test -v ./...

README.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
1+
# Brotli Decoder for Go
2+
3+
[![Go Reference](https://pkg.go.dev/badge/github.com/aperturerobotics/go-brotli-decoder.svg)](https://pkg.go.dev/github.com/aperturerobotics/go-brotli-decoder)
4+
[![Go Report Card Widget]][Go Report Card]
5+
6+
[Go Report Card Widget]: https://goreportcard.com/badge/github.com/aperturerobotics/go-brotli-decoder
7+
[Go Report Card]: https://goreportcard.com/report/github.com/aperturerobotics/go-brotli-decoder
8+
9+
## Introduction
10+
11+
This package is a brotli decompressor implemented in pure Go.
12+
113
This package is a brotli compressor and decompressor implemented in Go.
14+
215
It was translated from the reference implementation (https://github.com/google/brotli)
3-
with the `c2go` tool at https://github.com/andybalholm/c2go.
16+
with the `c2go** tool at https://github.com/andybalholm/c2go.
17+
18+
## Upstream
19+
20+
This package is a fork of the [upstream project] to create a more minimal
21+
package with just the decoder and not the encoder.
22+
23+
This is a significantly lighter package in terms of binary size.
424

5-
I have been working on new compression algorithms (not translated from C)
6-
in the matchfinder package.
7-
You can use them with the NewWriterV2 function.
8-
Currently they give better results than the old implementation
9-
(at least for compressing my test file, Newton’s *Opticks*)
10-
on levels 2 to 6.
25+
It was created by deleting the writer types and then repeatedly removing all
26+
unused symbols (detected with the gounused linter).
1127

12-
I am using it in production with https://github.com/andybalholm/redwood.
28+
If you need the brotli compressor, see the [upstream project].
1329

14-
API documentation is found at https://pkg.go.dev/github.com/andybalholm/brotli?tab=doc.
30+
[upstream project]: https://github.com/andybalholm/brotli

backward_references.go

Lines changed: 0 additions & 185 deletions
This file was deleted.

0 commit comments

Comments
 (0)