Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to go 1.23 #144

Merged
merged 1 commit into from
Sep 16, 2024
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
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.22.x, 1.23.x]
go-version: [1.23.x]

services:
redis:
Expand Down
5 changes: 3 additions & 2 deletions dates/i18n.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
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/nyaruka/gocommon

go 1.22
go 1.23

require (
github.com/aws/aws-sdk-go-v2 v1.30.5
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions httpx/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
Loading