Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard zero value Set methods #3957

Merged
merged 3 commits into from
Apr 4, 2023
Merged

Conversation

MrAlias
Copy link
Contributor

@MrAlias MrAlias commented Mar 31, 2023

The zero value Set will panic if Get, HasValue, or Value are called. This is not strictly a bug given there is a NewSet function that ensures this value of Set is never returned. However, adding these small checks help prevent users from introducing panics.

@MrAlias MrAlias added bug Something isn't working Skip Changelog PRs that do not require a CHANGELOG.md entry pkg:attribute Related to the attribute package labels Mar 31, 2023
@codecov
Copy link

codecov bot commented Mar 31, 2023

Codecov Report

Merging #3957 (a1b4d73) into main (65ebe5e) will increase coverage by 0.3%.
The diff coverage is 100.0%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #3957     +/-   ##
=======================================
+ Coverage   81.7%   82.0%   +0.3%     
=======================================
  Files        171     171             
  Lines      12951   12951             
=======================================
+ Hits       10592   10631     +39     
+ Misses      2136    2100     -36     
+ Partials     223     220      -3     
Impacted Files Coverage Δ
attribute/set.go 77.7% <100.0%> (+14.8%) ⬆️

... and 1 file with indirect coverage changes

@MrAlias MrAlias force-pushed the guard-set-methods branch from 225320e to 5057813 Compare March 31, 2023 23:49
@MrAlias MrAlias merged commit a25f4fe into open-telemetry:main Apr 4, 2023
@MrAlias MrAlias deleted the guard-set-methods branch April 4, 2023 15:06
@XSAM XSAM added this to the Old Untracked PRs milestone Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:attribute Related to the attribute package Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants