Get an existing input resource.

## Code sample

### Go


To learn how to install and use the client library for Live Stream API, see
[Live Stream API client libraries](https://docs.cloud.google.com/livestream/docs/reference/libraries.md.txt).


For more information, see the
[Live Stream API Go API
reference documentation](https://pkg.go.dev/cloud.google.com/go/video/livestream).


To authenticate to Live Stream API, 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"
	"fmt"
	"io"

	livestream "cloud.google.com/go/video/livestream/apiv1"
	livestreampb "cloud.google.com/go/video/livestream/apiv1/livestreampb"
)

// getInput retrieves an input resource.
func getInput(ctx context.Context, w io.Writer, projectID string, locationID string, inputID string) error {
	name := fmt.Sprintf("projects/%s/locations/%s/inputs/%s", projectID, locationID, inputID)

	client, err := livestream.NewClient(ctx)
	if err != nil {
		return fmt.Errorf("NewClient: %w", err)
	}
	defer client.Close()

	req := &livestreampb.GetInputRequest{
		Name: name,
	}

	response, err := client.GetInput(ctx, req)
	if err != nil {
		return fmt.Errorf("GetInput: %w", err)
	}

	fmt.Fprintf(w, "Input: %v\n", response.GetName())

	return nil
}
```

## 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=livestreamapi).