Sends a request without authentication using a gRPC connection.

## Explore further


For detailed documentation that includes this code sample, see the following:

- [Invoking with gRPC](https://docs.cloud.google.com/kubernetes-engine/enterprise/knative-serving/docs/triggering/grpc.md.txt)
- [Using gRPC](https://docs.cloud.google.com/run/docs/triggering/grpc.md.txt)

## Code sample

### Go


To authenticate to Cloud Run, set up Application Default Credentials.
For more information, see

[Set up authentication for a local development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment.md.txt).

```go

import (
	"context"
	"time"

	pb "github.com/GoogleCloudPlatform/golang-samples/run/grpc-ping/pkg/api/v1"
	"google.golang.org/grpc"
)

// pingRequest sends a new gRPC ping request to the server configured in the connection.
func pingRequest(conn *grpc.ClientConn, p *pb.Request) (*pb.Response, error) {
	ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
	defer cancel()

	client := pb.NewPingServiceClient(conn)
	return client.Send(ctx, p)
}
```

## What's next


To search and filter code samples for other Google Cloud products, see the
[Google Cloud sample browser](https://docs.cloud.google.com/docs/samples.md.txt?product=cloudrun).