Skip to content

Commit

Permalink
Use semconv pkg for schema URL in fetch.go
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Sep 15, 2023
1 parent 2dd287d commit f70951d
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions sdk/resource/internal/schema/generate/schema/fetch.go
Expand Up @@ -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()

Expand All @@ -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)
}

0 comments on commit f70951d

Please sign in to comment.