Skip to content

Commit

Permalink
Re-add support for go 1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Nov 12, 2024
1 parent 2a68fd5 commit a440c50
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.23.x]
go-version: [1.22.x, 1.23.x]

services:
redis:
Expand Down
5 changes: 2 additions & 3 deletions dates/i18n.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ package dates

import (
_ "embed"
"maps"
"slices"

"github.com/nyaruka/gocommon/i18n"
"github.com/nyaruka/gocommon/jsonx"
"golang.org/x/exp/maps"
)

// File containing day and month translations, generated using https://github.com/nyaruka/go-locales
Expand All @@ -31,7 +30,7 @@ var defaultLocale = "en_US"
func init() {
jsonx.MustUnmarshal(i18nJSON, &translations)

bcp47Matcher = i18n.NewBCP47Matcher(slices.Collect(maps.Keys(translations))...)
bcp47Matcher = i18n.NewBCP47Matcher(maps.Keys(translations)...)

// not all locales have AM/PM values.. but it's simpler if we just given them a default
for _, trans := range translations {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/nyaruka/gocommon

go 1.23
go 1.22.0

require (
github.com/aws/aws-sdk-go-v2 v1.32.4
Expand Down
5 changes: 2 additions & 3 deletions httpx/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import (
"errors"
"fmt"
"io"
"maps"
"net/http"
"slices"

"github.com/nyaruka/gocommon/jsonx"
"github.com/nyaruka/gocommon/stringsx"
"golang.org/x/exp/maps"
)

// MockRequestor is a requestor which can be mocked with responses for given URLs
Expand Down Expand Up @@ -43,7 +42,7 @@ func (r *MockRequestor) Do(client *http.Client, request *http.Request) (*http.Re
url := request.URL.String()

// find the most specific match against this URL
match := stringsx.GlobSelect(url, slices.Collect(maps.Keys(r.mocks))...)
match := stringsx.GlobSelect(url, maps.Keys(r.mocks)...)
mockedResponses := r.mocks[match]

if len(mockedResponses) == 0 {
Expand Down

0 comments on commit a440c50

Please sign in to comment.