Here’s a small quiz derived from some incorrect advice from an AI coding assistant.
package main
import (
"fmt"
"time"
)
func main() {
fmt.Println(time.Now())
defer fmt.Println(time.Now())
time.Sleep(10 * time.Second)
}
This program prints two timestamps; will they be
a. Roughly the same time (ie, the same second)
b. Roughly 10 seconds apart
c. Something else
Answer after the fold