I'm new to Go. I'm trying out this example where I want to perform a concurrent call from a method. This isn't working for me (I don't see the output).
Based on "Effective Go", it says concurrency is supported for methods and functions. What am I doing wrong?
Thanks, -Srikanth
package main
import (
"fmt"
)
type Hello struct {
a int
}
func (h *Hello) Myprint (value string) {
go func() {
fmt.Println(value)
} ()
}
func main() {
h := &Hello{100}
go h.Myprint("need to go")
}