Commit 794e970 1 parent 038712b commit 794e970 Copy full SHA for 794e970
File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -22,11 +22,13 @@ import (
22
22
// (`*resource.Resource`). The `nil` value is equivalent to an empty
23
23
// Resource.
24
24
//
25
- // While Resource is comparable, its comparison should not be relied on when
26
- // checking equality. The [Resource.Equal] method should be used to check
27
- // equality between two resources and the [attribute.Distinct] returned from
28
- // [Resource.Equivalent] should be used for map keys instead. No guantee of the
29
- // correctness of direct comparisons is provided.
25
+ // Note that the Go == operator compares not just the resource attributes but
26
+ // also all other internals of the Resource type. Therefore, Resource values
27
+ // should not be used as map or database keys. In general, the [Resource.Equal]
28
+ // method should be used instead of direct comparison with ==, since that
29
+ // method ensures the correct comparison of resource attributes, and the
30
+ // [attribute.Distinct] returned from [Resource.Equivalent] should be used for
31
+ // map and database keys instead.
30
32
type Resource struct {
31
33
attrs attribute.Set
32
34
schemaURL string
You can’t perform that action at this time.
0 commit comments