MCPcopy
hub / github.com/lmorg/murex / Define

Method Define

lang/methods.go:43–56  ·  view source on GitHub ↗

Define creates a record of a new method

(cmd, dataType string)

Source from the content-addressed store, hash-verified

41
42// Define creates a record of a new method
43func (m *methods) Define(cmd, dataType string) {
44 m.mutex.Lock()
45
46 cmds := m.dt[dataType]
47
48 if m.exists(cmd, dataType) != -1 {
49 m.mutex.Unlock()
50 debug.Log("method define", cmd, dataType, "exists")
51 return
52 }
53
54 m.dt[dataType] = append(cmds, cmd)
55 m.mutex.Unlock()
56}
57
58// Degroup takes the commands assigned to group types and sorts them back into individual types
59func (m *methods) Degroup() error {

Callers 15

degroupMethod · 0.95
readFlagsFunction · 0.45
TestBugFixFunction · 0.45
TestMethodExistsFunction · 0.45
TestMethodDefineFunction · 0.45
TestMethodsFunction · 0.45
TestMethodTypesFunction · 0.45
TestRunTestNotATestFunction · 0.45
TestRunTestNotAFunctionFunction · 0.45
DefineFunctionFunction · 0.45
DefineMethodFunction · 0.45
testRunTestFunction · 0.45

Calls 4

existsMethod · 0.95
LogFunction · 0.92
LockMethod · 0.45
UnlockMethod · 0.45

Tested by 13

TestBugFixFunction · 0.36
TestMethodExistsFunction · 0.36
TestMethodDefineFunction · 0.36
TestMethodsFunction · 0.36
TestMethodTypesFunction · 0.36
TestRunTestNotATestFunction · 0.36
TestRunTestNotAFunctionFunction · 0.36
testRunTestFunction · 0.36
configDefaultsFunction · 0.36
TestHighlighterFunction · 0.36
TestAnsiColouredFunction · 0.36
TestAnsiNoColourFunction · 0.36