From e4aee696fc05acf7b1afa61e6fbb415edd18c49d Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Mon, 16 Sep 2024 11:56:11 -0500 Subject: [PATCH] Update to go 1.23 --- .github/workflows/ci.yml | 2 +- dates/i18n.go | 5 +++-- go.mod | 4 ++-- httpx/mock.go | 5 +++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b321f7..12d114f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: [1.22.x, 1.23.x] + go-version: [1.23.x] services: redis: diff --git a/dates/i18n.go b/dates/i18n.go index 4007d84..d6000e6 100644 --- a/dates/i18n.go +++ b/dates/i18n.go @@ -2,10 +2,11 @@ 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 @@ -30,7 +31,7 @@ var defaultLocale = "en_US" func init() { jsonx.MustUnmarshal(i18nJSON, &translations) - bcp47Matcher = i18n.NewBCP47Matcher(maps.Keys(translations)...) + bcp47Matcher = i18n.NewBCP47Matcher(slices.Collect(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 { diff --git a/go.mod b/go.mod index 9cf3660..75b4316 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/nyaruka/gocommon -go 1.22 +go 1.23 require ( github.com/aws/aws-sdk-go-v2 v1.30.5 @@ -22,7 +22,6 @@ require ( github.com/nyaruka/phonenumbers v1.4.0 github.com/shopspring/decimal v1.4.0 github.com/stretchr/testify v1.9.0 - golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 golang.org/x/net v0.27.0 golang.org/x/sync v0.7.0 golang.org/x/text v0.16.0 @@ -52,6 +51,7 @@ require ( github.com/leodido/go-urn v1.4.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/crypto v0.25.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect golang.org/x/sys v0.22.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/httpx/mock.go b/httpx/mock.go index c794ef0..67a8e61 100644 --- a/httpx/mock.go +++ b/httpx/mock.go @@ -6,11 +6,12 @@ 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 @@ -42,7 +43,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, maps.Keys(r.mocks)...) + match := stringsx.GlobSelect(url, slices.Collect(maps.Keys(r.mocks))...) mockedResponses := r.mocks[match] if len(mockedResponses) == 0 {