Clone this repo:
  1. 4241954 xds: Move test only utility method to testutils. (#3715) by Easwar Swaminathan · 4 months ago master
  2. 31d22c7 examples: use grpc v1.30.0 rather than v1.30.0-dev.1 (#3710) by Patrice Chalin · 4 months ago
  3. 7a80883 examples: make test script output easier to read (#3711) by Patrice Chalin · 4 months ago
  4. 38aafd8 require ALL modules are tidy; tidy some that are not (#3709) by Doug Fawley · 4 months ago
  5. 4e63bca test: replace manual.GenerateAndRegisterManualResolver with grpc.WithResolvers (#3700) by Zou Nengren · 4 months ago


Build Status GoDoc GoReportCard

The Go implementation of gRPC: A high performance, open source, general RPC framework that puts mobile and HTTP/2 first. For more information see the gRPC Quick Start: Go guide.


To install this package, you need to install Go and setup your Go workspace on your computer. The simplest way to install the library is to run:

$ go get -u

With Go module support (Go 1.11+), simply import "" in your source code and go [build|run|test] will automatically download the necessary dependencies (Go modules ref).

If you are trying to access grpc-go from within China, please see the FAQ below.


gRPC-Go officially supports the three latest major releases of Go.



Performance benchmark data for grpc-go and other languages is maintained in this dashboard.


General Availability Google Cloud Platform Launch Stages.


I/O Timeout Errors

The domain may be blocked from some countries. go get usually produces an error like the following when this happens:

$ go get -u
package unrecognized import path "" (https fetch: Get dial tcp i/o timeout)

To build Go code, there are several options:

  • Set up a VPN and access through that.

  • Without Go module support: git clone the repo manually:

    git clone $GOPATH/src/

    You will need to do the same for all of grpc's dependencies in, e.g.

  • With Go module support: it is possible to use the replace feature of go mod to create aliases for packages. In your project's directory:

    go mod edit
    go mod tidy
    go mod vendor
    go build -mod=vendor

    Again, this will need to be done for all transitive dependencies hosted on as well. Please refer to this issue in the golang repo regarding this concern.

Compiling error, undefined: grpc.SupportPackageIsVersion

If you are using Go modules:

Please ensure your gRPC-Go version is required at the appropriate version in the same module containing the generated .pb.go files. For example, SupportPackageIsVersion6 needs v1.27.0, so in your go.mod file:

module <your module name>

require ( v1.27.0
If you are not using Go modules:

Please update proto package, gRPC package and rebuild the proto files:

  • go get -u{proto,protoc-gen-go}
  • go get -u
  • protoc --go_out=plugins=grpc:. *.proto

How to turn on logging

The default logger is controlled by the environment variables. Turn everything on by setting:


The RPC failed with error "code = Unavailable desc = transport is closing"

This error means the connection the RPC is using was closed, and there are many possible reasons, including:

  1. mis-configured transport credentials, connection failed on handshaking
  2. bytes disrupted, possibly by a proxy in between
  3. server shutdown
  4. Keepalive parameters caused connection shutdown, for example if you have configured your server to terminate connections regularly to trigger DNS lookups. If this is the case, you may want to increase your MaxConnectionAgeGrace, to allow longer RPC calls to finish.

It can be tricky to debug this because the error happens on the client side but the root cause of the connection being closed is on the server side. Turn on logging on both client and server, and see if there are any transport errors.