-
Notifications
You must be signed in to change notification settings - Fork 2
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
R/0.5.1 #13
R/0.5.1 #13
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13 +/- ##
==========================================
+ Coverage 90.75% 91.86% +1.10%
==========================================
Files 9 9
Lines 487 504 +17
==========================================
+ Hits 442 463 +21
+ Misses 37 32 -5
- Partials 8 9 +1 ☔ View full report in Codecov by Sentry. |
Quality Gate passedIssues Measures |
this.isBuilt = false | ||
this.isSealed = false | ||
this.DisableValidation = false | ||
lastContainerID = atomic.Int32{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these 2 lines will cause unpredictable behavior.
when I call con.clearAll()
, I would not expect it will impact other containers or future created containers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example of the unpredictable behavior:
func Test() {
con1 = NewContainer()
con1.RegisterSomething()
con1.clearAll() //got other idea, so reset the container
con1.RegisterSomethingElse()
con2 = NewContainer()
con2.Register()
}
I did not expect that con1.clearAll()
would have impact on con2
, and make it got the same ID as con1
, if the test continue there will be conflict between con1
and con2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO con.clearAll()
should impact only con
if for some reason you really want to reset the lastContainerID like this, then I suggest you would do it in another global function such as resetContainersIDCounter()
.
Anyway I'm curious about what was the motivation to reset this counter?
No description provided.