Skip to content

Commit

Permalink
go.mod,etc: bump to 1.23, use new funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
danp committed Aug 20, 2024
1 parent 2cbc075 commit 60ebac2
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.23'
- name: Checkout code
uses: actions/checkout@v4
- name: Test
Expand All @@ -18,7 +18,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.23'
cache: false
- name: Checkout code
uses: actions/checkout@v3
Expand Down
6 changes: 2 additions & 4 deletions cmd/bikehfx-tweet/daily.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"hash/crc32"
"image/color"
"log"
"maps"
"math"
"slices"
"strconv"
Expand All @@ -18,7 +19,6 @@ import (
"github.com/danp/counterbase/directory"
"github.com/graxinc/errutil"
"github.com/peterbourgon/ff/v3/ffcli"
"golang.org/x/exp/maps"
"golang.org/x/text/language"
"golang.org/x/text/message"
"gonum.org/v1/plot"
Expand Down Expand Up @@ -207,10 +207,8 @@ func dayPostText(day time.Time, w weather, cs []counterSeriesV2, records map[str
recordKinds[k] = struct{}{}
}
if len(recordKinds) > 0 {
keys := maps.Keys(recordKinds)
slices.Sort(keys)
p.Fprintln(&out)
for _, k := range keys {
for _, k := range slices.Sorted(maps.Keys(recordKinds)) {
p.Fprintln(&out, recordNote(k))
}
}
Expand Down
5 changes: 2 additions & 3 deletions cmd/bikehfx-tweet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"image/draw"
"image/png"
"log"
"maps"
"net/http"
"net/url"
"os"
Expand All @@ -26,7 +27,6 @@ import (
"github.com/graxinc/errutil"
"github.com/peterbourgon/ff/v3"
"github.com/peterbourgon/ff/v3/ffcli"
"golang.org/x/exp/maps"
"golang.org/x/image/font/opentype"
"gonum.org/v1/plot"
"gonum.org/v1/plot/font"
Expand Down Expand Up @@ -444,8 +444,7 @@ func yearWeekChart(trvs map[int]map[int]timeRangeValue, title string) ([]byte, e
})
p.Y.Tick.Marker = plot.TickerFunc(thousandTicker(p.Y.Tick.Marker))

years := maps.Keys(trvs)
slices.Sort(years)
years := slices.Sorted(maps.Keys(trvs))

thisYear := years[len(years)-1]

Expand Down
6 changes: 2 additions & 4 deletions cmd/bikehfx-tweet/monthly.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"cmp"
"context"
"flag"
"maps"
"slices"
"strings"
"time"

"github.com/graxinc/errutil"
"github.com/peterbourgon/ff/v3/ffcli"
"golang.org/x/exp/maps"
"golang.org/x/text/language"
"golang.org/x/text/message"
)
Expand Down Expand Up @@ -273,10 +273,8 @@ func monthPostText(monthRange timeRange, cs []counterSeriesV2, records map[strin
recordKinds[k] = struct{}{}
}
if len(recordKinds) > 0 {
keys := maps.Keys(recordKinds)
slices.Sort(keys)
p.Fprintln(&out)
for _, k := range keys {
for _, k := range slices.Sorted(maps.Keys(recordKinds)) {
p.Fprintln(&out, recordNote(k))
}
}
Expand Down
6 changes: 2 additions & 4 deletions cmd/bikehfx-tweet/weekly.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"cmp"
"context"
"flag"
"maps"
"slices"
"strings"
"time"

"github.com/graxinc/errutil"
"github.com/peterbourgon/ff/v3/ffcli"
"golang.org/x/exp/maps"
"golang.org/x/text/language"
"golang.org/x/text/message"
)
Expand Down Expand Up @@ -328,10 +328,8 @@ func weekPostText(weekRange timeRange, cs []counterSeriesV2, records map[string]
recordKinds[k] = struct{}{}
}
if len(recordKinds) > 0 {
keys := maps.Keys(recordKinds)
slices.Sort(keys)
p.Fprintln(&out)
for _, k := range keys {
for _, k := range slices.Sorted(maps.Keys(recordKinds)) {
p.Fprintln(&out, recordNote(k))
}
}
Expand Down
6 changes: 2 additions & 4 deletions cmd/bikehfx-tweet/yearly.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"cmp"
"context"
"flag"
"maps"
"slices"
"strings"
"time"

"github.com/graxinc/errutil"
"github.com/peterbourgon/ff/v3/ffcli"
"golang.org/x/exp/maps"
"golang.org/x/text/language"
"golang.org/x/text/message"
)
Expand Down Expand Up @@ -273,10 +273,8 @@ func yearPostText(yearRange timeRange, cs []counterSeriesV2, records map[string]
recordKinds[k] = struct{}{}
}
if len(recordKinds) > 0 {
keys := maps.Keys(recordKinds)
slices.Sort(keys)
p.Fprintln(&out)
for _, k := range keys {
for _, k := range slices.Sorted(maps.Keys(recordKinds)) {
p.Fprintln(&out, recordNote(k))
}
}
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/danp/bikehfx

go 1.22.0
go 1.23

require (
github.com/bluesky-social/indigo v0.0.0-20240308030717-06c2c155d0ca
Expand All @@ -13,7 +13,6 @@ require (
github.com/hexops/valast v1.4.4
github.com/mattn/go-mastodon v0.0.6
github.com/peterbourgon/ff/v3 v3.3.1
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
golang.org/x/image v0.15.0
golang.org/x/text v0.16.0
gonum.org/v1/plot v0.14.0
Expand Down Expand Up @@ -73,6 +72,7 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/sync v0.7.0 // indirect
Expand Down

0 comments on commit 60ebac2

Please sign in to comment.