Includes solved 02-worker-pool and 09-safe-counter (mutex, atomic, sharded). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GbnJj9ZqEx9nUvzkjdwfMq
11 lines
165 B
Go
11 lines
165 B
Go
// PREDICT: what happens? Then run it. Then fix it TWO different ways.
|
|
package main
|
|
|
|
import "fmt"
|
|
|
|
func main() {
|
|
ch := make(chan int)
|
|
ch <- 1
|
|
fmt.Println(<-ch)
|
|
}
|