Defer and sleep in Golang

Member

makayla.beahan

by makayla.beahan , in category: Golang , 2 months ago

Defer and sleep in Golang 😁

1
2
3
4
5
6
func GetUser() *User {
    defer func() {
        time.Sleep(100 * time.Millisecond)
    }()
    return &User{}
}


Facebook Twitter LinkedIn Telegram Whatsapp Pocket

no answers