package main import console "fmt" type Teiko []string type callback func(string,int) func (tei *Teiko)forEach(cb callback){ for index,value := range *tei{ value = value+"hh" cb(value,index) } } func main(){ us := &Teiko{"Norrris","Oduro","Teiko",} us.forEach(func(val string,i int){ console.Println(val) }); }
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more