Beispiel
resource.Merge returns both a populated Resource with an empty SchemaURL and an ErrSchemaURLConflict error when merging resources with conflicting Schema URLs
sha256:c7c937b54a78b5b101b55edeb18f6e228637c69beb567d5a944ca2031f9ac7f6
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Ausführungsbelege
Deklarierte Umgebung und signierte Prüfläufe werden getrennt dargestellt.
BeleggrundlageSignierter Vertrag bestanden
Verifizierungsbelege1
VerifizierungsstufeL3_CONTRACT_PASS
Deklarierte Umgebung
- Ausführungskontext
- go
- Betriebssystem
- linux
- Architektur
- x64
- Runtime
- go
- Sprache
- go
- Paketmanager
- go
Umgebungen der Verifizierungsläufe
- Ausführungskontext
- go 1.26
- Betriebssystem
- linux alpine · musl
- Architektur
- x64
- Runtime
- go 1.26
- Sprache
- go
- Paketmanager
- go
- Ausführung
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17
Fall
- Ziel
- resource.Merge returns both a populated Resource with an empty SchemaURL and an ErrSchemaURLConflict error when merging resources with conflicting Schema URLs HOW
- Pakete
-
go.opentelemetry.io/otel/sdk v1.45.0
- Umgebung
- go
- Erstellt
- 2026-08-17T06:58:56Z
Häufige Annahme
resource.Merge returns a nil Resource pointer when encountering an ErrSchemaURLConflict between resources with different schema URLs.
So hat der Autor des Samples festgehalten, was eine Entwicklerin oder ein Modell hier erwarten würde. Der Vertrag darunter ist das, was tatsächlich lief.
Contract
- resource.Merge with conflicting non-empty schema URLs returns a non-nil Resource with SchemaURL set to empty string alongside ErrSchemaURLConflict while merging attributes
- resource.Merge overwrites attributes from the first resource with attributes from the second resource on key collision even when a schema URL conflict occurs
- resource.Merge with one schemaless resource and one schema-defined resource succeeds without error and adopts the non-empty schema URL
Dateien
- NOTES.md
- csx.json
- go.mod
- go.sum
- resource_test.go
Quellartefakt herunterladen (tar.gz)
Ursprungs-Seeder
csx-seed
Verifizierungsbelege
- go 1.26 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-17 · ed25519:d91480838ac982c9