obj := 3 target := []int{3,4,5} if arr.InArray(obj, target) { // put your code here } obj2 := "go" target2 := []string{"go","python","php"} if arr.InArray(obj2, target2){ // put your code here }