gohamcrest.hasMapValue (golang)
10
Complexity
0
Duplication
1
Methods
14
Lines of Code
- map.go
- 11121314151617181920212223242526
func
(this *hasMapValue) Match(actual
interface
{}) bool {
listValue := reflect.ValueOf(actual)
flag := false
if
reflect.TypeOf(actual).Kind() == reflect.Map {
mapKeys := listValue.MapKeys()
for
i := 0; i < len(mapKeys); i++ {
if
mapKeys[i].Interface() == this.Expected {
flag = true
break
}
}
}
return
flag
}
- map.go
- 11121314151617181920212223242526
func
(this *hasMapValue) Match(actual
interface
{}) bool {
listValue := reflect.ValueOf(actual)
flag := false
if
reflect.TypeOf(actual).Kind() == reflect.Map {
mapKeys := listValue.MapKeys()
for
i := 0; i < len(mapKeys); i++ {
if
mapKeys[i].Interface() == this.Expected {
flag = true
break
}
}
}
return
flag
}