A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-176.go
1packagemain
2
3import"fmt"
4
5funcmain(){
6deferfmt.Print("!")
7deferfmt.Print("c")
8deferfmt.Print("b")
9deferfmt.Print("a")
10fmt.Print("> ")
11}
Defer
Answer & explanation
Console output
> abc!
Why
fmt.Print never appends a newline, so everything is one line. The body writes "> ", then the four defers unwind LIFO. The last deferred ("a") runs first, giving a, b, c, !. This is the exact reverse of how the "!" through "a" calls were written.