log: Add Record.Clone#6991
Closed
arjun7579 wants to merge 2 commits intoopen-telemetry:mainfrom
Closed
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6991 +/- ##
=======================================
- Coverage 82.7% 82.7% -0.1%
=======================================
Files 262 262
Lines 24325 24329 +4
=======================================
- Hits 20140 20136 -4
- Misses 3810 3818 +8
Partials 375 375
🚀 New features to boost your workflow:
|
pellared
reviewed
Jul 10, 2025
Member
There was a problem hiding this comment.
From https://github.com/open-telemetry/opentelemetry-go/blob/main/CONTRIBUTING.md:
update CHANGELOG.md
Each functionality should be covered by tests.
This should help you:
opentelemetry-go/sdk/log/record_test.go
Lines 140 to 204 in e4c84b9
Also linter failed with:
Error: log/record.go:146:1: File is not properly formatted (gofumpt)
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6986
Add the
Clone()method to thelog.Recordtype.It returns a copy of the record with no shared state, allowing both the original and the clone to be modified independently.
The
backslice is cloned usingslices.Cloneto avoid shared references.