Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
pellared committed Jan 13, 2025
1 parent 90d6886 commit 3e030c5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions config/v0.3.0/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,13 @@ func newResource(res *Resource) *resource.Resource {
return resource.Default()
}

schemaURL := ""
if res.SchemaUrl != nil {
schemaURL = *res.SchemaUrl
}

var attrs []attribute.KeyValue
for _, v := range res.Attributes {
attrs = append(attrs, keyVal(v.Name, v.Value))
}

return resource.NewWithAttributes(schemaURL, attrs...)
if res.SchemaUrl == nil {
return resource.NewSchemaless(attrs...)
}
return resource.NewWithAttributes(*res.SchemaUrl, attrs...)
}

0 comments on commit 3e030c5

Please sign in to comment.