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
10 changes: 5 additions & 5 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.24
go-version: 1.25

- name: Write coverage profile
run: go test -v ./... -coverprofile=./coverage.txt -covermode=atomic
Expand All @@ -44,17 +44,17 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go_versions: [ '1.23', '1.24' ]
go_versions: [ '1.24', '1.25' ]
os: [ubuntu-latest, windows-2022, macos-14]
exclude:
# Only latest Go version for Windows and MacOS.
- os: windows-2022
go_versions: '1.23'
go_versions: '1.24'
- os: macos-14
go_versions: '1.23'
go_versions: '1.24'
# Exclude latest Go version for Ubuntu as Coverage uses it.
- os: ubuntu-latest
go_versions: '1.24'
go_versions: '1.25'
fail-fast: false
steps:
- uses: actions/checkout@v4
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/nspcc-dev/go-ordered-json

go 1.22
go 1.24
4 changes: 2 additions & 2 deletions number_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ func TestNumberIsValid(t *testing.T) {

func BenchmarkNumberIsValid(b *testing.B) {
s := "-61657.61667E+61673"
for range b.N {
for b.Loop() {
isValidNumber(s)
}
}

func BenchmarkNumberIsValidRegexp(b *testing.B) {
var jsonNumberRegexp = regexp.MustCompile(`^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$`)
s := "-61657.61667E+61673"
for range b.N {
for b.Loop() {
jsonNumberRegexp.MatchString(s)
}
}
3 changes: 1 addition & 2 deletions scanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,7 @@ var benchScan scanner

func BenchmarkSkipValue(b *testing.B) {
initBig()
b.ResetTimer()
for range b.N {
for b.Loop() {
_, _, _ = nextValue(jsonBig, &benchScan)
}
b.SetBytes(int64(len(jsonBig)))
Expand Down
9 changes: 1 addition & 8 deletions tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,10 @@ func (o tagOptions) Contains(optionName string) bool {
if len(o) == 0 {
return false
}
s := string(o)
for s != "" {
var next string
i := strings.Index(s, ",")
if i >= 0 {
s, next = s[:i], s[i+1:]
}
for s := range strings.FieldsFuncSeq(string(o), func(c rune) bool { return c == ',' }) {
if s == optionName {
return true
}
s = next
}
return false
}
Loading