aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2026-06-17 23:23:52 +0200
committerStefan Majewsky <majewsky@gmx.net>2026-06-17 23:23:52 +0200
commitb95ec7449ebec844221f80ecbf7976f3af878eee (patch)
treed8f612b04db980fb878efd0aabb3fe2ba6d3113f
parentc6b1e6cd164067f623ecd0b1208a73214ea1a0d6 (diff)
downloadgo-gg-b95ec7449ebec844221f80ecbf7976f3af878eee.tar.gz
raise minimum Go version to 1.26
-rw-r--r--CHANGELOG.md6
-rw-r--r--columnar/columnar.go3
-rw-r--r--columnar/columnar_test.go10
-rw-r--r--go.mod2
-rw-r--r--internal/test/helpers.go4
-rw-r--r--option/option_test.go2
-rw-r--r--options/options_test.go2
7 files changed, 15 insertions, 14 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 279db3d..405af16 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,12 @@ SPDX-FileCopyrightText: 2026 Stefan Majewsky <majewsky@gmx.net>
SPDX-License-Identifier: Apache-2.0
-->
+# v1.10.0 (TBD)
+
+Changes:
+
+- The minimum Go version was increased from 1.24 to 1.26.
+
# v1.9.1 (2026-06-17)
Changes:
diff --git a/columnar/columnar.go b/columnar/columnar.go
index 5e339ab..fad6627 100644
--- a/columnar/columnar.go
+++ b/columnar/columnar.go
@@ -57,8 +57,7 @@ var columnarListTypes = map[reflect.Type]reflect.Type{}
type List[T any] []T
func foreachRelevantField(t reflect.Type, action func(f reflect.StructField)) {
- for idx := range t.NumField() {
- f := t.Field(idx)
+ for f := range t.Fields() {
if f.PkgPath == "" && f.Tag.Get("json") != "-" {
action(f)
}
diff --git a/columnar/columnar_test.go b/columnar/columnar_test.go
index 70e27c4..3e050ce 100644
--- a/columnar/columnar_test.go
+++ b/columnar/columnar_test.go
@@ -84,9 +84,9 @@ func TestJSONRoundtripResolvesPointers(t *testing.T) {
}
testSuccessfulJSONRoundtrip(t,
[]***Record{
- PointerTo(PointerTo(PointerTo(Record{1, 2}))),
- PointerTo(PointerTo(PointerTo(Record{2, 4}))),
- PointerTo(PointerTo(PointerTo(Record{3, 6}))),
+ new(new(new(Record{1, 2}))),
+ new(new(new(Record{2, 4}))),
+ new(new(new(Record{3, 6}))),
},
jsonmatch.Object{
"Foo": jsonmatch.Array{1, 2, 3},
@@ -103,7 +103,7 @@ func TestJSONRoundtripErrors(t *testing.T) {
_, err := json.Marshal(columnar.List[nothingPublic]{{1, 2}})
AssertEqual(t, err.Error(), `json: error calling MarshalJSON for type columnar.List[go.xyrillian.de/gg/columnar_test.nothingPublic·5]: columnar_test.nothingPublic has no exported fields`)
- err = json.Unmarshal([]byte(`{}`), PointerTo(columnar.List[nothingPublic]{}))
+ err = json.Unmarshal([]byte(`{}`), new(columnar.List[nothingPublic]{}))
AssertEqual(t, err.Error(), `columnar_test.nothingPublic has no exported fields`)
}
@@ -113,7 +113,7 @@ func TestJSONUnmarshalFromInconsistentLengths(t *testing.T) {
Bar int
}
- err := json.Unmarshal([]byte(`{"Foo":[1,2],"Bar":[3,4,5]}`), PointerTo(columnar.List[Record]{}))
+ err := json.Unmarshal([]byte(`{"Foo":[1,2],"Bar":[3,4,5]}`), new(columnar.List[Record]{}))
AssertEqual(t, err.Error(), `cannot unmarshal from columns with inconsistent lengths [2 3]`)
}
diff --git a/go.mod b/go.mod
index d2dc1a5..deaffce 100644
--- a/go.mod
+++ b/go.mod
@@ -1,3 +1,3 @@
module go.xyrillian.de/gg
-go 1.24
+go 1.26
diff --git a/internal/test/helpers.go b/internal/test/helpers.go
index c466c69..4cfca1e 100644
--- a/internal/test/helpers.go
+++ b/internal/test/helpers.go
@@ -19,7 +19,3 @@ func AssertEqual[V any](t *testing.T, actual, expected V) bool {
t.Errorf("expected %#v, but got %#v", expected, actual)
return false
}
-
-func PointerTo[V any](value V) *V {
- return &value
-}
diff --git a/option/option_test.go b/option/option_test.go
index a5eb3ff..646108a 100644
--- a/option/option_test.go
+++ b/option/option_test.go
@@ -22,7 +22,7 @@ func TestZeroValue(t *testing.T) {
func TestAsPointer(t *testing.T) {
AssertEqual(t, None[int]().AsPointer(), nil)
- AssertEqual(t, Some(42).AsPointer(), PointerTo(42))
+ AssertEqual(t, Some(42).AsPointer(), new(42))
}
func TestAsSlice(t *testing.T) {
diff --git a/options/options_test.go b/options/options_test.go
index b80d550..fab378b 100644
--- a/options/options_test.go
+++ b/options/options_test.go
@@ -13,7 +13,7 @@ import (
func TestFromPointer(t *testing.T) {
AssertEqual(t, FromPointer[int](nil), None[int]())
- AssertEqual(t, FromPointer(PointerTo[int](42)), Some(42))
+ AssertEqual(t, FromPointer(new(int(42))), Some(42))
}
func TestIsNoneOrZero(t *testing.T) {