From 47ee315bef0dc3e83d30f4f504d0c94608c7429f Mon Sep 17 00:00:00 2001 From: Toan Nguyen Date: Mon, 23 Sep 2024 16:05:39 +0700 Subject: [PATCH] ci: fix the deprecated docker-compose command (#154) * ci: fix the deprecated docker-compose command --- .github/workflows/test.yml | 2 +- example/graphqldev/go.mod | 2 +- example/graphqldev/go.sum | 3 +-- subscription_graphql_ws_test.go | 4 ++-- subscriptions_transport_ws.go | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 526b6f2..8bcecbe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,7 +37,7 @@ jobs: - name: Setup integration test infrastructure run: | cd ./example/hasura - docker-compose up -d + docker compose up -d - name: Lint uses: golangci/golangci-lint-action@v6 with: diff --git a/example/graphqldev/go.mod b/example/graphqldev/go.mod index c8bd327..0c2c3b2 100644 --- a/example/graphqldev/go.mod +++ b/example/graphqldev/go.mod @@ -8,8 +8,8 @@ require ( ) require ( + github.com/coder/websocket v1.8.12 // indirect github.com/google/uuid v1.6.0 // indirect - nhooyr.io/websocket v1.8.10 // indirect ) replace github.com/hasura/go-graphql-client => ../../ diff --git a/example/graphqldev/go.sum b/example/graphqldev/go.sum index 57eaa55..2e5b7fa 100644 --- a/example/graphqldev/go.sum +++ b/example/graphqldev/go.sum @@ -1,3 +1,4 @@ +github.com/coder/websocket v1.8.12 h1:5bUXkEPPIbewrnkU8LTCLVaxi4N4J8ahufH2vlo4NAo= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -17,5 +18,3 @@ go.opentelemetry.io/otel/trace v1.6.3/go.mod h1:GNJQusJlUgZl9/TQBPKU/Y/ty+0iVB5f golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -nhooyr.io/websocket v1.8.10 h1:mv4p+MnGrLDcPlBoWsvPP7XCzTYMXP9F9eIGoKbgx7Q= -nhooyr.io/websocket v1.8.10/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c= diff --git a/subscription_graphql_ws_test.go b/subscription_graphql_ws_test.go index 6d861a2..53b0c01 100644 --- a/subscription_graphql_ws_test.go +++ b/subscription_graphql_ws_test.go @@ -71,9 +71,9 @@ func waitService(endpoint string, timeoutSecs int) error { if res != nil { body, err := io.ReadAll(res.Body) if err != nil { - return fmt.Errorf(res.Status) + return errors.New(res.Status) } - return fmt.Errorf(string(body)) + return errors.New(string(body)) } return errors.New("unknown error") } diff --git a/subscriptions_transport_ws.go b/subscriptions_transport_ws.go index c7a0431..4952095 100644 --- a/subscriptions_transport_ws.go +++ b/subscriptions_transport_ws.go @@ -155,7 +155,7 @@ func (stw *subscriptionsTransportWS) OnMessage(ctx *SubscriptionContext, subscri // try to parse the error object var payload interface{} - err := fmt.Errorf(string(message.Payload)) + err := errors.New(string(message.Payload)) jsonErr := json.Unmarshal(message.Payload, &payload) if jsonErr == nil { var errMsg string