diff --git a/.circleci/Dockerfile b/.circleci/Dockerfile index 9285342ec0f..10ee4847f30 100644 --- a/.circleci/Dockerfile +++ b/.circleci/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:latest +FROM golang:1.11 ## Warm apt cache RUN apt-get update @@ -26,11 +26,6 @@ RUN apt-get install -y wget bzip2 && \ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash && \ apt-get remove -y wget -# Install dep -RUN apt-get install -y wget && \ - wget -qO- https://raw.githubusercontent.com/golang/dep/master/install.sh | sh && \ - apt-get remove -y wget - # Clean up RUN apt-get autoremove -y && \ rm -rf /var/lib/apt/lists/* diff --git a/.circleci/config.yml b/.circleci/config.yml index cac9aa698e0..3a172fabb9c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -64,8 +64,8 @@ jobs: EOF - run: name: Check that Bazel BUILD files are up-to-date - command: 'test -z "$(bazel run //:gazelle_diff)" || - (echo "ERROR: Bazel files out-of-date, please run \`bazel run :gazelle_fix\`" >&2; exit 1)' + command: 'bazel run //:gazelle || + (echo "ERROR: Bazel files out-of-date, please run \`bazel run :gazelle\`" >&2; exit 1)' - run: name: Run tests with Bazel command: bazel test //... diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 04fc20639c9..0c4e8287ca8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,7 +29,7 @@ docker run -v $(pwd):/src/grpc-gateway --rm jfbrandhorst/grpc-gateway-build-env make realclean && \ make examples SWAGGER_CODEGEN="${SWAGGER_CODEGEN}"' docker run -itv $(pwd):/grpc-gateway -w /grpc-gateway --entrypoint /bin/bash --rm \ - l.gcr.io/google/bazel -c 'bazel run :gazelle_fix; bazel run :buildifier' + l.gcr.io/google/bazel -c 'bazel run :gazelle; bazel run :buildifier' ``` If this has resulted in some file changes in the repo, please ensure you check those in with your merge request. diff --git a/Makefile b/Makefile index f25e14d7cde..7ca298961a7 100644 --- a/Makefile +++ b/Makefile @@ -177,6 +177,7 @@ $(RESPONSE_BODY_EXAMPLE_SRCS): $(RESPONSE_BODY_EXAMPLE_SPEC) $(EXAMPLE_CLIENT_DIR)/responsebody/git_push.sh examples: $(EXAMPLE_DEPSRCS) $(EXAMPLE_SVCSRCS) $(EXAMPLE_GWSRCS) $(EXAMPLE_SWAGGERSRCS) $(EXAMPLE_CLIENT_SRCS) + find -type f -name *.go -exec sed -s -i 's;github.com/go-resty/resty;gopkg.in/resty.v1;g' {} + test: examples go test -race ... go test -race examples/integration -args -network=unix -endpoint=test.sock diff --git a/WORKSPACE b/WORKSPACE index 4ba250819c1..66c7f2061ef 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -21,12 +21,10 @@ go_rules_dependencies() go_register_toolchains() -load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") +load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") gazelle_dependencies() -load("@bazel_gazelle//:deps.bzl", "go_repository") - # Also define in Gopkg.toml go_repository( name = "org_golang_google_genproto", @@ -43,9 +41,9 @@ go_repository( # Also define in Gopkg.toml go_repository( - name = "com_github_go_resty_resty", - commit = "f8815663de1e64d57cdd4ee9e2b2fa96977a030e", - importpath = "github.com/go-resty/resty", + name = "in_gopkg_resty_v1", + commit = "fa5875c0caa5c260ab78acec5a244215a730247f", + importpath = "gopkg.in/resty.v1", ) # Also define in Gopkg.toml diff --git a/examples/clients/abe/BUILD.bazel b/examples/clients/abe/BUILD.bazel index 4d3c3546e93..4c28ed28d6a 100644 --- a/examples/clients/abe/BUILD.bazel +++ b/examples/clients/abe/BUILD.bazel @@ -30,6 +30,6 @@ go_library( "//examples/proto/examplepb:go_default_library", "//examples/proto/pathenum:go_default_library", "//runtime:go_default_library", - "@com_github_go_resty_resty//:go_default_library", + "@in_gopkg_resty_v1//:go_default_library", ], ) diff --git a/examples/clients/abe/api_client.go b/examples/clients/abe/api_client.go index bf3e21a9fb1..d6bc762e9bd 100644 --- a/examples/clients/abe/api_client.go +++ b/examples/clients/abe/api_client.go @@ -18,7 +18,7 @@ import ( "strings" "net/url" "io/ioutil" - "github.com/go-resty/resty" + "gopkg.in/resty.v1" ) type APIClient struct { diff --git a/examples/clients/echo/BUILD.bazel b/examples/clients/echo/BUILD.bazel index 090b56aafab..97f3f317ba5 100644 --- a/examples/clients/echo/BUILD.bazel +++ b/examples/clients/echo/BUILD.bazel @@ -13,5 +13,5 @@ go_library( "examplepb_simple_message.go", ], importpath = "github.com/grpc-ecosystem/grpc-gateway/examples/clients/echo", - deps = ["@com_github_go_resty_resty//:go_default_library"], + deps = ["@in_gopkg_resty_v1//:go_default_library"], ) diff --git a/examples/clients/echo/api_client.go b/examples/clients/echo/api_client.go index 7a517148026..d3facaa4633 100644 --- a/examples/clients/echo/api_client.go +++ b/examples/clients/echo/api_client.go @@ -18,7 +18,7 @@ import ( "strings" "net/url" "io/ioutil" - "github.com/go-resty/resty" + "gopkg.in/resty.v1" ) type APIClient struct { diff --git a/examples/clients/responsebody/BUILD.bazel b/examples/clients/responsebody/BUILD.bazel index e621bea6960..0f7ce09fc40 100644 --- a/examples/clients/responsebody/BUILD.bazel +++ b/examples/clients/responsebody/BUILD.bazel @@ -19,5 +19,5 @@ go_library( ], importpath = "github.com/grpc-ecosystem/grpc-gateway/examples/clients/responsebody", visibility = ["//visibility:public"], - deps = ["@com_github_go_resty_resty//:go_default_library"], + deps = ["@in_gopkg_resty_v1//:go_default_library"], ) diff --git a/examples/clients/responsebody/api_client.go b/examples/clients/responsebody/api_client.go index 1f7354b61dc..1ac422ec895 100644 --- a/examples/clients/responsebody/api_client.go +++ b/examples/clients/responsebody/api_client.go @@ -18,7 +18,7 @@ import ( "strings" "net/url" "io/ioutil" - "github.com/go-resty/resty" + "gopkg.in/resty.v1" ) type APIClient struct { diff --git a/examples/clients/unannotatedecho/BUILD.bazel b/examples/clients/unannotatedecho/BUILD.bazel index 611c6c7052d..c7c60503b9c 100644 --- a/examples/clients/unannotatedecho/BUILD.bazel +++ b/examples/clients/unannotatedecho/BUILD.bazel @@ -12,5 +12,5 @@ go_library( "unannotated_echo_service_api.go", ], importpath = "github.com/grpc-ecosystem/grpc-gateway/examples/clients/unannotatedecho", - deps = ["@com_github_go_resty_resty//:go_default_library"], + deps = ["@in_gopkg_resty_v1//:go_default_library"], ) diff --git a/examples/clients/unannotatedecho/api_client.go b/examples/clients/unannotatedecho/api_client.go index aa4c1f14e42..c898727e74b 100644 --- a/examples/clients/unannotatedecho/api_client.go +++ b/examples/clients/unannotatedecho/api_client.go @@ -18,7 +18,7 @@ import ( "strings" "net/url" "io/ioutil" - "github.com/go-resty/resty" + "gopkg.in/resty.v1" ) type APIClient struct { diff --git a/examples/proto/examplepb/BUILD.bazel b/examples/proto/examplepb/BUILD.bazel index f819a9472dd..abff1fb6d90 100644 --- a/examples/proto/examplepb/BUILD.bazel +++ b/examples/proto/examplepb/BUILD.bazel @@ -66,7 +66,6 @@ go_library( "@org_golang_google_grpc//codes:go_default_library", "@org_golang_google_grpc//grpclog:go_default_library", "@org_golang_google_grpc//status:go_default_library", - "@org_golang_x_net//context:go_default_library", ], ) diff --git a/go.mod b/go.mod index 9284d871c75..e63e264f1b9 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,6 @@ module github.com/grpc-ecosystem/grpc-gateway require ( github.com/ghodss/yaml v1.0.0 - github.com/go-resty/resty v1.9.0 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b github.com/golang/protobuf v1.2.0 github.com/kr/pretty v0.1.0 // indirect @@ -12,7 +11,6 @@ require ( google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 google.golang.org/grpc v1.19.0 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect + gopkg.in/resty.v1 v1.12.0 gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7 // indirect ) - -replace github.com/go-resty/resty => gopkg.in/resty.v1 v1.9.0 diff --git a/go.sum b/go.sum index 78191e96227..186bc4101fc 100644 --- a/go.sum +++ b/go.sum @@ -16,7 +16,6 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af h1:gu+uRPtBe88sKxUCEXRoeCvVG90TJmwhiqRpvdhQFng= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/net v0.0.0-20180611182652-db08ff08e862/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3 h1:eH6Eip3UpmR+yM/qI9Ijluzb1bNv/cAU/n+6l8tRSis= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -36,7 +35,8 @@ google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/resty.v1 v1.9.0/go.mod h1:vo52Hzryw9PnPHcJfPsBiFW62XhNx5OczbV9y+IMpgc= +gopkg.in/resty.v1 v1.12.0 h1:CuXP0Pjfw9rOuY6EP+UvtNvt5DSqHpIxILZKT/quCZI= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7 h1:+t9dhfO+GNOIGJof6kPOAenx7YgrZMTdRPV+EsnPabk= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=