fork download
  1. package main
  2.  
  3. type T struct {
  4. msg string
  5. }
  6.  
  7. var g *T
  8.  
  9. func setup() {
  10. t := new(T)
  11. t.msg = "hello, world"
  12. g = t
  13. }
  14.  
  15. func main() {
  16. go setup()
  17. for g == nil {
  18. print("1")
  19. }
  20. print(g.msg)
  21. }
  22.  
Runtime error #stdin #stdout 0.15s 420288KB
stdin
Standard input is empty
stdout
Standard output is empty