Relative Content

Tag Archive for gotime

Is time.AfterFunc() creates new goroutine each time it called

Is time.AfterFunc() creates new goroutine each time it called ? I heard that time.AfterFunc() creates special buffer and create only one goroutine to handle thats buffer, then time.AfterFunc() called N times it’s just append buffer and do not create new goroutine, so goroutine that was created earlier will process buffer

Go – time.Parse issue

package main import ( “fmt” “time” ) func main() { date := “1/5/2122” conv, err := time.Parse(“25/12/2006”, date) if err != nil { fmt.Println(err) } fmt.Printf(“%v”, conv) } The error showing up : parsing time “1/5/2122” as “25/12/2006”: cannot parse “/5/2122” as “5” Seems to be some delimiter issue, but I’m not sure where exactly […]