diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 4ead3ade..75f7f7ff 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - go-version: [1.17, 1.18] + go-version: [1.18, 1.19] steps: - uses: actions/checkout@v2 @@ -30,7 +30,14 @@ jobs: run: go get -t -v ./ably/... - name: Format - run: if [ "$(gofmt -l . | wc -l)" -gt 0 ]; then exit 1; fi + run: | + if go version | awk '$3 !~ /go1.18/ {exit(1)}'; + then + echo -n Skipping gofmt test for ; + go version + exit 0 + fi + if [ "$(gofmt -l . | wc -l)" -gt 0 ]; then exit 1; fi - name: Vet run: go vet ./ably/... ./scripts/... diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index efbad34e..6a4746a3 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - go-version: [1.17, 1.18] + go-version: [1.18, 1.19] protocol: ['json', 'msgpack'] steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index d6bab68b..794d5752 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## [1.2.9](https://github.com/ably/ably-go/tree/v1.2.9) + +[Full Changelog](https://github.com/ably/ably-go/compare/v1.2.8...v1.2.9) + +**Merged pull requests:** + +- Test against go 1.19, and drop support for 1.17 [\#563](https://github.com/ably/ably-go/pull/563) ([amnonbc](https://github.com/amnonbc)) +- fix GO-2022-0493 [\#562](https://github.com/ably/ably-go/pull/562) ([amnonbc](https://github.com/amnonbc)) + ## [1.2.8](https://github.com/ably/ably-go/tree/v1.2.8) [Full Changelog](https://github.com/ably/ably-go/compare/v1.2.7...v1.2.8) (2022-07-01) diff --git a/README.md b/README.md index b6f51862..e0a3c5bf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ ## [Ably Go](https://ably.com/) [![.github/workflows/check.yml](https://github.com/ably/ably-go/actions/workflows/check.yml/badge.svg)](https://github.com/ably/ably-go/actions/workflows/check.yml) +[![.github/workflows/integration-test.yml](https://github.com/ably/ably-go/actions/workflows/integration-test.yml/badge.svg)](https://github.com/ably/ably-go/actions/workflows/integration-test.yml) [![Go Reference](https://pkg.go.dev/badge/github.com/ably/ably-go/ably.svg)](https://pkg.go.dev/github.com/ably/ably-go/ably) @@ -360,4 +361,4 @@ Please visit https://faqs.ably.com/ for access to our knowledgebase. If you requ You can also view the [community reported Github issues](https://github.com/ably/ably-go/issues). ## Contributing -For guidance on how to contribute to this project, see [CONTRIBUTING.md](CONTRIBUTING.md). \ No newline at end of file +For guidance on how to contribute to this project, see [CONTRIBUTING.md](CONTRIBUTING.md). diff --git a/ably/proto_http.go b/ably/proto_http.go index fbf301ec..be173171 100644 --- a/ably/proto_http.go +++ b/ably/proto_http.go @@ -10,7 +10,7 @@ const ( ablyVersionHeader = "X-Ably-Version" ablyErrorCodeHeader = "X-Ably-Errorcode" ablyErrorMessageHeader = "X-Ably-Errormessage" - libraryVersion = "1.2.8" + libraryVersion = "1.2.9" libraryName = "go" ablyVersion = "1.2" ablyClientIDHeader = "X-Ably-ClientId" diff --git a/ably/proto_message.go b/ably/proto_message.go index 2405f6ad..dc819cc4 100644 --- a/ably/proto_message.go +++ b/ably/proto_message.go @@ -55,7 +55,7 @@ func (p *protocolMessage) updateInnerMessageEmptyFields(m *Message, index int) { } } -//updateInnerMessagesEmptyFields updates [Message.ID], [Message.ConnectionID] and [Message.Timestamp] with +// updateInnerMessagesEmptyFields updates [Message.ID], [Message.ConnectionID] and [Message.Timestamp] with // outer/parent message fields. func (p *protocolMessage) updateInnerMessagesEmptyFields() { for i, m := range p.Messages { diff --git a/ably/realtime_presence_integration_test.go b/ably/realtime_presence_integration_test.go index 686fe906..f29c4925 100644 --- a/ably/realtime_presence_integration_test.go +++ b/ably/realtime_presence_integration_test.go @@ -141,8 +141,8 @@ func TestRealtimePresence_EnsureChannelIsAttached(t *testing.T) { assert.NoError(t, err) } -//When a client is created with a ClientID, Enter is used to announce the client's presence. -//This example shows Client A entering their presence. +// When a client is created with a ClientID, Enter is used to announce the client's presence. +// This example shows Client A entering their presence. func ExampleRealtimePresence_Enter() { // A new realtime client is created with a ClientID. diff --git a/ably/realtime_presence_test.go b/ably/realtime_presence_test.go index e4e08cf0..e6d28464 100644 --- a/ably/realtime_presence_test.go +++ b/ably/realtime_presence_test.go @@ -11,7 +11,7 @@ import ( "github.com/ably/ably-go/ably" ) -//When a client is created without a ClientID, EnterClient is used to announce the presence of a client. +// When a client is created without a ClientID, EnterClient is used to announce the presence of a client. // This example shows a client without a clientID announcing the presence of "Client A" using EnterClient. func ExampleRealtimePresence_EnterClient() { diff --git a/ably/rest_channel.go b/ably/rest_channel.go index 72eba752..ffd55804 100644 --- a/ably/rest_channel.go +++ b/ably/rest_channel.go @@ -54,8 +54,9 @@ func (c *RESTChannel) Publish(ctx context.Context, name string, data interface{} // RESTChannel.Publish and RESTChannel.PublishMultiple. // // TODO: This started out as just an option for PublishMultiple, but has since -// been added as an option for Publish too, so it should be renamed to -// PublishOption when we perform the next major version bump to 2.x.x. +// +// been added as an option for Publish too, so it should be renamed to +// PublishOption when we perform the next major version bump to 2.x.x. type PublishMultipleOption func(*publishMultipleOptions) type publishMultipleOptions struct { diff --git a/ablytest/proxies.go b/ablytest/proxies.go index e3184f38..ef242640 100644 --- a/ablytest/proxies.go +++ b/ablytest/proxies.go @@ -113,7 +113,6 @@ func MustAuthReverseProxy(opts ...ably.ClientOption) *AuthReverseProxy { // - "token", which responds with (ably.TokenDetails).Token as a string // - "details", which responds with ably.TokenDetails // - "request", which responds with ably.TokenRequest -// func (srv *AuthReverseProxy) URL(responseType string) string { return "http://" + srv.Listener.Addr().String() + "/" + responseType } diff --git a/go.mod b/go.mod index c49d8bef..9ff9d62e 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/ably/ably-go require ( github.com/stretchr/testify v1.7.1 github.com/ugorji/go/codec v1.1.9 - golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 + golang.org/x/sys v0.2.0 nhooyr.io/websocket v1.8.7 ) diff --git a/go.sum b/go.sum index 553607d4..59a3d2b7 100644 --- a/go.sum +++ b/go.sum @@ -52,8 +52,8 @@ github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLY github.com/ugorji/go/codec v1.1.9 h1:J/7hhpkQwgypRNvaeh/T5gzJ2gEI/l8S3qyRrdEa1fA= github.com/ugorji/go/codec v1.1.9/go.mod h1:+SWgpdqOgdW5sBaiDfkHilQ1SxQ1hBkq/R+kHfL7Suo= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=