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
14 changes: 7 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
linux:
strategy:
matrix:
go: ["1.23", "1.24", "1.25"]
go: ["1.24", "1.25"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -31,7 +31,7 @@ jobs:
linux-32bit:
strategy:
matrix:
go: ["1.23"]
go: ["1.24"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -47,7 +47,7 @@ jobs:
darwin:
strategy:
matrix:
go: ["1.23"]
go: ["1.24"]
runs-on: macos-15
steps:
- uses: actions/checkout@v2
Expand All @@ -63,7 +63,7 @@ jobs:
linux-stress:
strategy:
matrix:
go: ["1.23"]
go: ["1.24"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -80,7 +80,7 @@ jobs:
linux-stress-race:
strategy:
matrix:
go: ["1.23"]
go: ["1.24"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -97,7 +97,7 @@ jobs:
linux-cockroach-go:
runs-on: ubuntu-latest
env:
GO_BRANCH: cockroach-go1.23.12
GO_BRANCH: cockroach-go1.25.3

steps:
- uses: actions/checkout@v4
Expand All @@ -120,7 +120,7 @@ jobs:
- name: Install bootstrap Go
uses: actions/setup-go@v5
with:
go-version: "1.23.x"
go-version: "1.24.x"

# Step 4: Run tests with custom Go
- run: ./scripts/run-tests-with-custom-go.sh ./...
Expand Down
14 changes: 10 additions & 4 deletions crstrings/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package crstrings

import (
"fmt"
"iter"
"slices"
"strings"
)
Expand Down Expand Up @@ -87,15 +88,20 @@ func FilterEmpty(elems []string) []string {

// Lines breaks up the given string into lines.
func Lines(s string) []string {
return slices.Collect(LinesSeq(s))
}

// LinesSeq returns an iterator over the lines of the given string.
func LinesSeq(s string) iter.Seq[string] {
// Remove any trailing newline (to avoid getting an extraneous empty line at
// the end).
s = strings.TrimSuffix(s, "\n")
if s == "" {
// In this case, Split returns a slice with a single empty string (which is
// not what we want).
return nil
// In this case, SplitSeq returns an iterator with a single empty string
// (which is not what we want).
return func(yield func(string) bool) {}
}
return strings.Split(s, "\n")
return strings.SplitSeq(s, "\n")
}

// Indent prepends a string to every line of the given string.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/cockroachdb/crlib

go 1.23
go 1.24
4 changes: 2 additions & 2 deletions internal/devtools/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/cockroachdb/crlib/internal/devtools

go 1.23
go 1.24

toolchain go1.24.2
toolchain go1.24.10

require (
github.com/cockroachdb/crlfmt v0.2.1
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-tests-with-custom-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ GO_REPO="https://github.com/cockroachdb/go.git"
GO_SHA="${GO_SHA:-}"

if [ -z "$GO_SHA" ]; then
GO_BRANCH="${GO_BRANCH:-cockroach-go1.23.12}"
GO_BRANCH="${GO_BRANCH:-cockroach-go1.25.3}"
echo "==> Resolving latest SHA for branch $GO_BRANCH..."
GO_SHA=$(git ls-remote "$GO_REPO" "refs/heads/$GO_BRANCH" | cut -f1)
fi
Expand Down
Loading