MCPcopy Create free account
hub / github.com/gavv/httpexpect / newMatch

Function newMatch

match.go:52–70  ·  view source on GitHub ↗
(parent *chain, submatchValues []string, submatchNames []string)

Source from the content-addressed store, hash-verified

50}
51
52func newMatch(parent *chain, submatchValues []string, submatchNames []string) *Match {
53 m := &Match{parent.clone(), nil, nil}
54
55 if submatchValues != nil {
56 m.submatchValues = make([]string, len(submatchValues))
57 copy(m.submatchValues, submatchValues)
58 } else {
59 m.submatchValues = []string{}
60 }
61
62 m.submatchNames = map[string]int{}
63 for n, name := range submatchNames {
64 if name != "" {
65 m.submatchNames[name] = n
66 }
67 }
68
69 return m
70}
71
72// Raw returns underlying submatches attached to Match.
73// This is the value originally passed to NewMatch.

Callers 6

TestMatch_FailedChainFunction · 0.85
TestMatch_ConstructorsFunction · 0.85
NewMatchFunction · 0.85
NewMatchCFunction · 0.85
MatchMethod · 0.85
MatchAllMethod · 0.85

Calls 1

cloneMethod · 0.45

Tested by 2

TestMatch_FailedChainFunction · 0.68
TestMatch_ConstructorsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…