{"slug": "go-pop-quiz-what-time-was-it", "title": "Go Pop quiz: what time was it?", "summary": "A Go quiz asks readers to predict the output of a program that prints two timestamps separated by a 10-second sleep, testing understanding of deferred function evaluation in Go.", "body_md": "Here’s a small quiz derived from some incorrect advice from an AI coding assistant.\n\n```\npackage main\n\nimport (\n    \"fmt\"\n    \"time\"\n)\n\nfunc main() {\n    fmt.Println(time.Now())\n    defer fmt.Println(time.Now())\n    time.Sleep(10 * time.Second)\n}\n```\n\nThis program prints two timestamps; will they be\n\na. Roughly the same time (ie, the same second)\n\nb. Roughly 10 seconds apart\n\nc. Something else\n\nAnswer after the fold\n\nPages: 1", "url": "https://wpnews.pro/news/go-pop-quiz-what-time-was-it", "canonical_source": "https://dave.cheney.net/2025/12/18/pop-quiz-what-time-was-it", "published_at": "2026-07-10 22:33:16+00:00", "updated_at": "2026-07-10 22:35:07.356763+00:00", "lang": "en", "topics": ["developer-tools"], "entities": [], "alternates": {"html": "https://wpnews.pro/news/go-pop-quiz-what-time-was-it", "markdown": "https://wpnews.pro/news/go-pop-quiz-what-time-was-it.md", "text": "https://wpnews.pro/news/go-pop-quiz-what-time-was-it.txt", "jsonld": "https://wpnews.pro/news/go-pop-quiz-what-time-was-it.jsonld"}}