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

Re-add support for go 1.22 #145

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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.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
Loading