Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build:
strategy:
matrix:
go-version: [1.23.x, 1.24.x, 1.25.x]
go-version: [1.24.x, 1.25.x, 1.26.x]
os: [ubuntu-latest, macos-latest, windows-latest]
env:
CGO_ENABLED: 0
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v6.2.0
with:
go-version: 1.25.x
go-version: 1.26.x

- name: Checkout code
uses: actions/checkout@v6.0.2
Expand All @@ -82,7 +82,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v6.2.0
with:
go-version: 1.25.x
go-version: 1.26.x

- name: Checkout code
uses: actions/checkout@v6.0.2
Expand All @@ -97,10 +97,10 @@ jobs:
run: go build github.com/klauspost/compress/s2/cmd/s2c && go build github.com/klauspost/compress/s2/cmd/s2d&&./s2c -verify s2c &&./s2d s2c.s2&&rm ./s2c&&rm s2d&&rm s2c.s2

- name: goreleaser deprecation
run: curl -sfL https://git.io/goreleaser | VERSION=v2.3.2 sh -s -- check
run: curl -sfL https://goreleaser.com/static/run | VERSION=v2.13.3 bash -s -- check

- name: goreleaser snapshot
run: curl -sL https://git.io/goreleaser | VERSION=v2.3.2 sh -s -- --snapshot --clean
run: curl -sfL https://goreleaser.com/static/run | VERSION=v2.13.3 bash -s -- --snapshot --clean

- name: Test S2 GOAMD64 v3
env:
Expand All @@ -125,7 +125,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v6.2.0
with:
go-version: 1.25.x
go-version: 1.26.x

- name: Checkout code
uses: actions/checkout@v6.0.2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
name: Set up Go
uses: actions/setup-go@a5f9b05d2d216f63e13859e0d847461041025775 # v5.2.0
with:
go-version: 1.25.x
go-version: 1.26.x
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
with:
version: 2.11.2
version: 2.13.3
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
11 changes: 10 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ builds:
- mips64le
goarm:
- 7
ignore:
- goos: windows
goarch: arm
-
id: "s2d"
binary: s2d
Expand All @@ -57,6 +60,9 @@ builds:
- mips64le
goarm:
- 7
ignore:
- goos: windows
goarch: arm
-
id: "s2sx"
binary: s2sx
Expand Down Expand Up @@ -84,14 +90,17 @@ builds:
- mips64le
goarm:
- 7
ignore:
- goos: windows
goarch: arm

archives:
-
id: s2-binaries
name_template: "s2-{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
format_overrides:
- goos: windows
format: zip
formats: ['zip']
files:
- unpack/*
- s2/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion flate/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func Example_synchronization() {
}

b := make([]byte, 256)
for _, m := range strings.Fields("A long time ago in a galaxy far, far away...") {
for m := range strings.FieldsSeq("A long time ago in a galaxy far, far away...") {
// We use a simple framing format where the first byte is the
// message length, followed the message itself.
b[0] = uint8(copy(b[1:], m))
Expand Down
1 change: 0 additions & 1 deletion flate/regmask_other.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build !amd64
// +build !amd64

package flate

Expand Down
1 change: 0 additions & 1 deletion flate/writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ func TestWriter_Reset(t *testing.T) {
}
in := buf.Bytes()
for l := range 10 {
l := l
if testing.Short() && l > 1 {
continue
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/klauspost/compress

go 1.23
go 1.24

retract (
// https://github.com/klauspost/compress/issues/1114
Expand Down
11 changes: 3 additions & 8 deletions gzhttp/asserts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package gzhttp

import (
"reflect"
"slices"
"testing"
)

Expand Down Expand Up @@ -51,7 +52,7 @@ func isNil(object any) bool {
[]reflect.Kind{
reflect.Chan, reflect.Func,
reflect.Interface, reflect.Map,
reflect.Ptr, reflect.Slice},
reflect.Pointer, reflect.Slice},
kind)

if isNilableKind && value.IsNil() {
Expand All @@ -63,11 +64,5 @@ func isNil(object any) bool {

// containsKind checks if a specified kind in the slice of kinds.
func containsKind(kinds []reflect.Kind, kind reflect.Kind) bool {
for i := range kinds {
if kind == kinds[i] {
return true
}
}

return false
return slices.Contains(kinds, kind)
}
52 changes: 6 additions & 46 deletions gzip/gzip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,12 @@ func testFileWindow(i, window int, t *testing.T) {
}

func testBigGzip(i int, t *testing.T) {
rng := rand.New(rand.NewSource(1337))
if len(testbuf) != i {
// Make results predictable
rand.Seed(1337)
testbuf = make([]byte, i)
for idx := range testbuf {
testbuf[idx] = byte(65 + rand.Intn(20))
testbuf[idx] = byte(65 + rng.Intn(20))
}
}
c := BestCompression
Expand Down Expand Up @@ -441,10 +441,10 @@ func testDeterm(level int, t *testing.T) {
if testing.Short() {
length = 100000
}
rand.Seed(1337)
rng := rand.New(rand.NewSource(1337))
t1 := make([]byte, length)
for idx := range t1 {
t1[idx] = byte(65 + rand.Intn(8))
t1[idx] = byte(65 + rng.Intn(8))
}

br := bytes.NewBuffer(t1)
Expand All @@ -462,10 +462,10 @@ func testDeterm(level int, t *testing.T) {

// We recreate the buffer, so we have a goos chance of getting a
// different memory address.
rand.Seed(1337)
rng = rand.New(rand.NewSource(1337))
t2 := make([]byte, length)
for idx := range t2 {
t2[idx] = byte(65 + rand.Intn(8))
t2[idx] = byte(65 + rng.Intn(8))
}

br2 := bytes.NewBuffer(t2)
Expand Down Expand Up @@ -538,46 +538,6 @@ func benchmarkGzipN(b *testing.B, level int) {
}
}

/*
func BenchmarkOldGzipL1(b *testing.B) { benchmarkOldGzipN(b, 1) }
func BenchmarkOldGzipL2(b *testing.B) { benchmarkOldGzipN(b, 2) }
func BenchmarkOldGzipL3(b *testing.B) { benchmarkOldGzipN(b, 3) }
func BenchmarkOldGzipL4(b *testing.B) { benchmarkOldGzipN(b, 4) }
func BenchmarkOldGzipL5(b *testing.B) { benchmarkOldGzipN(b, 5) }
func BenchmarkOldGzipL6(b *testing.B) { benchmarkOldGzipN(b, 6) }
func BenchmarkOldGzipL7(b *testing.B) { benchmarkOldGzipN(b, 7) }
func BenchmarkOldGzipL8(b *testing.B) { benchmarkOldGzipN(b, 8) }
func BenchmarkOldGzipL9(b *testing.B) { benchmarkOldGzipN(b, 9) }

func benchmarkOldGzipN(b *testing.B, level int) {
dat, _ := os.ReadFile("testdata/test.json")
dat = append(dat, dat...)
dat = append(dat, dat...)
dat = append(dat, dat...)
dat = append(dat, dat...)
dat = append(dat, dat...)

b.SetBytes(int64(len(dat)))
w, _ := oldgz.NewWriterLevel(io.Discard, level)
b.ResetTimer()
for n := 0; n < b.N; n++ {
w.Reset(io.Discard)
n, err := w.Write(dat)
if n != len(dat) {
panic("short write")
}
if err != nil {
panic(err)
}
err = w.Close()
if err != nil {
panic(err)
}
}
}

*/

func BenchmarkCompressAllocations(b *testing.B) {
payload := []byte(strings.Repeat("Tiny payload", 20))
for j := -2; j <= 9; j++ {
Expand Down
2 changes: 1 addition & 1 deletion huff0/_generate/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/klauspost/compress/huff0/_generate

go 1.23
go 1.24

toolchain go1.24.2

Expand Down
1 change: 0 additions & 1 deletion huff0/decompress_amd64.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build amd64 && !appengine && !noasm && gc
// +build amd64,!appengine,!noasm,gc

// This file contains the specialisation of Decoder.Decompress4X
// and Decoder.Decompress1X that use an asm implementation of thir main loops.
Expand Down
1 change: 0 additions & 1 deletion huff0/decompress_generic.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build !amd64 || appengine || !gc || noasm
// +build !amd64 appengine !gc noasm

// This file contains a generic implementation of Decoder.Decompress4X.
package huff0
Expand Down
1 change: 0 additions & 1 deletion internal/cpuinfo/cpuinfo_amd64.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build amd64 && !appengine && !noasm && gc
// +build amd64,!appengine,!noasm,gc

package cpuinfo

Expand Down
4 changes: 1 addition & 3 deletions s2/cmd/_s2sx/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/klauspost/compress/s2/cmd/_s2sx

go 1.23

toolchain go1.24.2
go 1.24

require github.com/klauspost/compress v1.11.9

Expand Down
4 changes: 2 additions & 2 deletions s2/cmd/s2d/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ Options:`)
for _, filename := range files {
dstFilename := cleanFileName(filename)
block := *block
if strings.HasSuffix(dstFilename, ".block") {
dstFilename = strings.TrimSuffix(dstFilename, ".block")
if before, ok := strings.CutSuffix(dstFilename, ".block"); ok {
dstFilename = before
block = true
}
switch {
Expand Down
1 change: 0 additions & 1 deletion s2/decode_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// license that can be found in the LICENSE file.

//go:build (!amd64 && !arm64) || appengine || !gc || noasm
// +build !amd64,!arm64 appengine !gc noasm

package s2

Expand Down
1 change: 0 additions & 1 deletion s2/encode_amd64.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build !appengine && !noasm && gc
// +build !appengine,!noasm,gc

package s2

Expand Down
1 change: 0 additions & 1 deletion s2/encode_go.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build !amd64 || appengine || !gc || noasm
// +build !amd64 appengine !gc noasm

package s2

Expand Down
1 change: 0 additions & 1 deletion s2/fuzz_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build go1.18
// +build go1.18

package s2

Expand Down
1 change: 0 additions & 1 deletion zip/internal/obscuretestdata/obscuretestdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.

//go:build go1.16
// +build go1.16

// Package obscuretestdata contains functionality used by tests to more easily
// work with testdata that must be obscured primarily due to
Expand Down
2 changes: 1 addition & 1 deletion zstd/_generate/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/klauspost/compress/zstd/_generate

go 1.23
go 1.24

toolchain go1.24.2

Expand Down
1 change: 0 additions & 1 deletion zstd/fse_decoder_amd64.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build amd64 && !appengine && !noasm && gc
// +build amd64,!appengine,!noasm,gc

package zstd

Expand Down
1 change: 0 additions & 1 deletion zstd/fse_decoder_generic.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build !amd64 || appengine || !gc || noasm
// +build !amd64 appengine !gc noasm

package zstd

Expand Down
1 change: 0 additions & 1 deletion zstd/fuzz_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build go1.18
// +build go1.18

package zstd

Expand Down
1 change: 0 additions & 1 deletion zstd/internal/xxhash/xxhash_other.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build (!amd64 && !arm64) || appengine || !gc || purego || noasm
// +build !amd64,!arm64 appengine !gc purego noasm

package xxhash

Expand Down
1 change: 0 additions & 1 deletion zstd/matchlen_amd64.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build amd64 && !appengine && !noasm && gc
// +build amd64,!appengine,!noasm,gc

// Copyright 2019+ Klaus Post. All rights reserved.
// License information can be found in the LICENSE file.
Expand Down
1 change: 0 additions & 1 deletion zstd/matchlen_generic.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build !amd64 || appengine || !gc || noasm
// +build !amd64 appengine !gc noasm

// Copyright 2019+ Klaus Post. All rights reserved.
// License information can be found in the LICENSE file.
Expand Down
1 change: 0 additions & 1 deletion zstd/race_enabled_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// License information can be found in the LICENSE file.

//go:build race
// +build race

package zstd

Expand Down
1 change: 0 additions & 1 deletion zstd/seqdec_amd64.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build amd64 && !appengine && !noasm && gc
// +build amd64,!appengine,!noasm,gc

package zstd

Expand Down
1 change: 0 additions & 1 deletion zstd/seqdec_amd64_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build amd64 && !appengine && !noasm && gc
// +build amd64,!appengine,!noasm,gc

package zstd

Expand Down
Loading
Loading