MCPcopy Index your code
hub / github.com/evilsocket/opensnitch / setUniqueName

Method setUniqueName

daemon/rule/loader.go:332–342  ·  view source on GitHub ↗
(rule *Rule)

Source from the content-addressed store, hash-verified

330}
331
332func (l *Loader) setUniqueName(rule *Rule) {
333 l.Lock()
334 defer l.Unlock()
335
336 idx := 1
337 base := rule.Name
338 for l.isUniqueName(rule.Name) == false {
339 idx++
340 rule.Name = fmt.Sprintf("%s-%d", base, idx)
341 }
342}
343
344func (l *Loader) setLiveReloadRunning(running bool) {
345 l.Lock()

Callers 1

addUserRuleMethod · 0.95

Calls 3

isUniqueNameMethod · 0.95
LockMethod · 0.80
UnlockMethod · 0.80

Tested by

no test coverage detected