func ListSecrets(w io.Writer, parent string) (error) {
	// parent := "projects/my-project"

	// Create the client.
	ctx := context.Background()
	client, err := secretmanager.NewClient(ctx)
	if err != nil {
			return fmt.Errorf("failed to create secretmanager client: %v", err)
	}
	defer client.Close()

	// Build the request.
	req := &secretmanagerpb.ListSecretsRequest{
			Parent: parent,
	}

	// Call the API.
	it := client.ListSecrets(ctx, req)
	for {
			resp, err := it.Next()
			if err == iterator.Done {
					break
			}

			if err != nil {
					return fmt.Errorf("failed to list secret versions: %v", err)
			}

			fmt.Fprintf(w, "%s\n", resp.Name)
	}

	return nil
}
// listSecrets lists all secrets in the given project.
listSecrets lists all secrets in the given project.
// listSecrets lists all secrets in the given project .
func ListSecrets(w io.Writer, parent string) (error) {
	ctx := context.Background()
	client, err := secretmanager.NewClient(ctx)
	if err != nil {
			return fmt.Errorf("failed to create secretmanager client: %v", err)
	}
	defer client.Close()
	req := &secretmanagerpb.ListSecretsRequest{
			Parent: parent,
	}
	it := client.ListSecrets(ctx, req)
	for {
			resp, err := it.Next()
			if err == iterator.Done {
					break
			}
			if err != nil {
					return fmt.Errorf("failed to list secret versions: %v", err)
			}
			fmt.Fprintf(w, "%s\n", resp.Name)
	}
	return nil
}
func ListSecrets ( w io . Writer , parent string ) ( error ) { ctx := context . Background ( ) client , err := secretmanager . NewClient ( ctx ) if err != nil { return fmt . Errorf ( " " , err ) } defer client . Close ( ) req := & secretmanagerpb . ListSecretsRequest { Parent : parent , } it := client . ListSecrets ( ctx , req ) for { resp , err := it . Next ( ) if err == iterator . Done { break } if err != nil { return fmt . Errorf ( " " , err ) } fmt . Fprintf ( w , " \n " , resp . Name ) } return nil }
listSecrets lists all secrets in the given project.
listSecrets lists all secrets in the given project .
// parent := "projects/my-project" // Create the client. // Build the request. // Call the API.