v1 Supprimer une révision d'un schéma (OBSOLETE)
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
(OBSOLÈTE) Supprimer une révision d'un schéma
Exemple de code
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],[],[],[],null,["# v1 Delete a revision from a schema (DEPRECATED)\n\n(DEPRECATED) Delete a revision from a schema\n\nCode sample\n-----------\n\n### Go\n\n\nBefore trying this sample, follow the Go setup instructions in the\n[Pub/Sub quickstart using\nclient libraries](/pubsub/docs/quickstart-client-libraries).\n\n\nFor more information, see the\n[Pub/Sub Go API\nreference documentation](https://godoc.org/cloud.google.com/go/pubsub).\n\n\nTo authenticate to Pub/Sub, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n import (\n \t\"context\"\n \t\"fmt\"\n \t\"io\"\n\n \t\"cloud.google.com/go/pubsub\"\n )\n\n func deleteSchemaRevision(w io.Writer, projectID, schemaID, revisionID string) error {\n \t// projectID := \"my-project-id\"\n \t// schemaID := \"my-schema-id\"\n \t// revisionID := \"my-revision-id\"\n \tctx := context.Background()\n \tclient, err := pubsub.NewSchemaClient(ctx, projectID)\n \tif err != nil {\n \t\treturn fmt.Errorf(\"pubsub.NewSchemaClient: %w\", err)\n \t}\n \tdefer client.Close()\n\n \tif _, err := client.DeleteSchemaRevision(ctx, schemaID, revisionID); err != nil {\n \t\treturn fmt.Errorf(\"client.DeleteSchema revision: %w\", err)\n \t}\n \tfmt.Fprintf(w, \"Deleted a schema revision: %s@%s\", schemaID, revisionID)\n \treturn nil\n }\n\nWhat's next\n-----------\n\n\nTo search and filter code samples for other Google Cloud products, see the\n[Google Cloud sample browser](/docs/samples?product=pubsub)."]]