You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thank you for writing this linter, as I could not find anything similar anywhere else!
I notice that mulint seems to only traverse function calls that are written as simple statements where the return value is not used. So if a function call is used in an expression then mulint will ignore it.
For example, mulint can detect this deadlock:
typesomeStructstruct {
m sync.RWMutex
}
func (s*someStruct) A() {
s.m.RLock()
s.B()
s.m.RUnlock()
}
func (s*someStruct) B() bool {
s.m.RLock() // This is a recursive lock and it should be detected by this tools.m.RUnlock()
returntrue
}
...but not this one:
typesomeStructstruct {
m sync.RWMutex
}
func (s*someStruct) A() {
s.m.RLock()
v:=s.B() // ***** This is the only difference. *****fmt.Println(v)
s.m.RUnlock()
}
func (s*someStruct) B() bool {
s.m.RLock() // This is a recursive lock and it should be detected by this tools.m.RUnlock()
returntrue
}
The text was updated successfully, but these errors were encountered:
Hi, thank you for writing this linter, as I could not find anything similar anywhere else!
I notice that mulint seems to only traverse function calls that are written as simple statements where the return value is not used. So if a function call is used in an expression then mulint will ignore it.
For example, mulint can detect this deadlock:
...but not this one:
The text was updated successfully, but these errors were encountered: