Skip to content

Commit

Permalink
added locks on main switches
Browse files Browse the repository at this point in the history
  • Loading branch information
Firas Darwish committed Nov 11, 2024
1 parent c686cbb commit 215eb30
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ore.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ func appendToAliases[TInterface, TImpl any]() {
}

func Build() {
lock.Lock()
defer lock.Unlock()
if isBuilt {
panic(alreadyBuilt)
}
Expand Down Expand Up @@ -128,8 +130,8 @@ func Validate() {
}

lock.Lock()
defer lock.Unlock()
if isBuilt && isSealed == false {
isSealed = true
}

Check warning on line 136 in ore.go

View check run for this annotation

Codecov / codecov/patch

ore.go#L135-L136

Added lines #L135 - L136 were not covered by tests
lock.Unlock()
}

0 comments on commit 215eb30

Please sign in to comment.