Browse Source

InArray, Argumente umgedreht

test
Klaus Wendel 4 years ago
parent
commit
dd6a462a2f
  1. 4
      ebkTools.go

4
ebkTools.go

@ -110,7 +110,7 @@ func Ip4or6(s string) uint8 {
return 0
}
func InArray(val interface{}, array interface{}) (exists bool, index int) {
func InArray(array interface{}, value interface{}) (exists bool, index int) {
exists = false
index = -1
@ -119,7 +119,7 @@ func InArray(val interface{}, array interface{}) (exists bool, index int) {
s := reflect.ValueOf(array)
for i := 0; i < s.Len(); i++ {
if reflect.DeepEqual(val, s.Index(i).Interface()) == true {
if reflect.DeepEqual(value, s.Index(i).Interface()) == true {
index = i
exists = true
return

Loading…
Cancel
Save