MCPcopy
hub / github.com/YaoApp/yao / Merge

Method Merge

widgets/action/process.go:32–56  ·  view source on GitHub ↗

Merge a process

(newProcess *Process)

Source from the content-addressed store, hash-verified

30
31// Merge a process
32func (p *Process) Merge(newProcess *Process) *Process {
33
34 if newProcess == nil {
35 return p
36 }
37
38 if newProcess.Name != "" {
39 p.Name = newProcess.Name
40 }
41
42 if p.Process == "" {
43 p.Process = newProcess.Process
44 }
45
46 if p.ProcessBind == "" {
47 p.ProcessBind = newProcess.ProcessBind
48 }
49
50 if p.Guard == "" {
51 p.Guard = newProcess.Guard
52 }
53
54 p.DefaultMerge(newProcess.Default)
55 return p
56}
57
58// DefaultMerge merge the default value.
59// option[0] the default is false, if true overwrite by the default value;

Callers 15

loadFromBinFunction · 0.80
SetDefaultProcessMethod · 0.80
SetDefaultProcessMethod · 0.80
BindFormMethod · 0.80
BindTableMethod · 0.80
SetDefaultProcessMethod · 0.80
BindTableMethod · 0.80
TestNewProcessFunction · 0.80
TestProcessOfFunction · 0.80
testDataFunction · 0.80
SetDefaultProcessMethod · 0.80
BindTableMethod · 0.80

Calls 1

DefaultMergeMethod · 0.95

Tested by 3

TestNewProcessFunction · 0.64
TestProcessOfFunction · 0.64
testDataFunction · 0.64