So, i have my slice renamed for using in functions, which one connected to array (like a class methods).
type Points []Point
func (p Points) Isset(ip Point) bool {
for _, i := range p {
if i.Hash == ip.Hash {
return true
}
}
return false
}
But it's doesn't matter, coz in another function, which one tried to pass slice with type Points, i have some trouble...
Here is example:
func (p Points) Merge(ip Points) {
fmt.Println(p)
}
In first function - i can access to my p
variable as array. In second - p
- just empty array. But if i change type of passed variable - everything will be fine.
What should i do... I need to specify me merge function. And this solution look's like awesome, but doesn't work.