Skip to content

Commit

Permalink
Fix support for Go < 1.21
Browse files Browse the repository at this point in the history
Technically I'm fixing it at the same time that I'm removing the tests
in the pipeline that would have caught this. Version support lower than
the last 3 minor versions is definitely not a priority, and only
something I'm fixing here because it's absolutely trivial.
  • Loading branch information
rliebz committed Jan 1, 2025
1 parent 767ccd8 commit 066e2d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
- ubuntu-latest
- windows-latest
go-version:
- '1.20'
- '1.21'
- '1.22'
- '1.23'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -43,7 +43,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
go-version: '1.23'
- name: Lint
uses: golangci/golangci-lint-action@v3
with:
Expand Down
6 changes: 3 additions & 3 deletions internal/jsondiff/jsondiff.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"encoding/json"
"fmt"
"reflect"
"slices"
"sort"
"strconv"
"strings"
)
Expand Down Expand Up @@ -149,7 +149,7 @@ func (d *differ) diffMaps(got, want map[string]any) {
for k := range keys {
sortedKeys = append(sortedKeys, k)
}
slices.Sort(sortedKeys)
sort.Strings(sortedKeys)

first := true
for _, k := range sortedKeys {
Expand Down Expand Up @@ -300,7 +300,7 @@ func (d *differ) writeMap(m map[string]any) {
for k := range m {
keys = append(keys, k)
}
slices.Sort(keys)
sort.Strings(keys)

first := true
for _, k := range keys {
Expand Down

0 comments on commit 066e2d4

Please # to comment.