From f70951da8353dff11ad7e16e6d2fe4c5924b3682 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 15 Sep 2023 12:17:20 -0700 Subject: [PATCH] Use semconv pkg for schema URL in fetch.go --- .../internal/schema/generate/schema/fetch.go | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/sdk/resource/internal/schema/generate/schema/fetch.go b/sdk/resource/internal/schema/generate/schema/fetch.go index 283c5236c85..9ce2d8ccf63 100644 --- a/sdk/resource/internal/schema/generate/schema/fetch.go +++ b/sdk/resource/internal/schema/generate/schema/fetch.go @@ -20,20 +20,17 @@ import ( "log" "net/http" "os" -) - -const ( - // schemaURL is the target schema to download. - schemaURL = "https://opentelemetry.io/schemas/1.21.0" - // dest is the output file. - dest = "schema.yaml" + semconv "go.opentelemetry.io/otel/semconv/v1.21.0" ) +// dest is the output file. +const dest = "schema.yaml" + func run() error { - resp, err := http.Get(schemaURL) + resp, err := http.Get(semconv.SchemaURL) if err != nil { - return fmt.Errorf("failed to download %q: %w", schemaURL, err) + return fmt.Errorf("failed to download %q: %w", semconv.SchemaURL, err) } defer resp.Body.Close() @@ -57,5 +54,5 @@ func main() { if err := run(); err != nil { log.Fatal(err) } - log.Printf("downloaded %q", schemaURL) + log.Printf("downloaded %q", semconv.SchemaURL) }