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

R/0.5.1 #13

Merged
merged 13 commits into from
Nov 13, 2024
Merged

R/0.5.1 #13

merged 13 commits into from
Nov 13, 2024

Conversation

firasdarwish
Copy link
Owner

No description provided.

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

Attention: Patch coverage is 77.77778% with 14 lines in your changes missing coverage. Please review.

Project coverage is 91.86%. Comparing base (aeb9fe1) to head (823283e).
Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
key.go 61.90% 8 Missing ⚠️
container.go 70.00% 3 Missing and 3 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

Copy link

@firasdarwish firasdarwish merged commit ee9933b into main Nov 13, 2024
7 of 8 checks passed
@firasdarwish firasdarwish deleted the r/0.5.1 branch November 13, 2024 18:59
this.isBuilt = false
this.isSealed = false
this.DisableValidation = false
lastContainerID = atomic.Int32{}
Copy link
Collaborator

@duongphuhiep duongphuhiep Nov 13, 2024

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.

Copy link
Collaborator

@duongphuhiep duongphuhiep Nov 13, 2024

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

Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants