MCPcopy
hub / github.com/httprunner/httprunner / mergeMap

Function mergeMap

hrp/parser.go:329–345  ·  view source on GitHub ↗

merge two map, the first map have higher priority

(m, overriddenMap map[string]string)

Source from the content-addressed store, hash-verified

327
328// merge two map, the first map have higher priority
329func mergeMap(m, overriddenMap map[string]string) map[string]string {
330 if overriddenMap == nil {
331 return m
332 }
333 if m == nil {
334 return overriddenMap
335 }
336
337 mergedMap := make(map[string]string)
338 for k, v := range overriddenMap {
339 mergedMap[k] = v
340 }
341 for k, v := range m {
342 mergedMap[k] = v
343 }
344 return mergedMap
345}
346
347// merge two validators slice, the first validators have higher priority
348func mergeValidators(validators, overriddenValidators []interface{}) []interface{} {

Callers 3

TestMergeMapFunction · 0.85
prepareHeadersMethod · 0.85
extendWithAPIFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestMergeMapFunction · 0.68