mirror of
https://github.com/bootdotdev/fcc-learn-golang-assets.git
synced 2025-12-11 15:51:16 +00:00
29 lines
476 B
Go
29 lines
476 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
func sendEmail(message string) {
|
|
go func() {
|
|
time.Sleep(time.Millisecond * 250)
|
|
fmt.Printf("Email received: '%s'\n", message)
|
|
}()
|
|
fmt.Printf("Email sent: '%s'\n", message)
|
|
}
|
|
|
|
// Don't touch below this line
|
|
|
|
func test(message string) {
|
|
sendEmail(message)
|
|
time.Sleep(time.Millisecond * 500)
|
|
fmt.Println("========================")
|
|
}
|
|
|
|
func main() {
|
|
test("Hello there Stacy!")
|
|
test("Hi there John!")
|
|
test("Hey there Jane!")
|
|
}
|