fork download
  1. package main
  2. import "fmt"
  3.  
  4. type Foo struct {
  5. Bar string
  6. }
  7.  
  8. func main(){
  9. x := nil
  10. x = &Foo { "hello" }
  11. fmt.Println(x.Bar)
  12. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
# _/home/xaFMxC
./prog.go:9: use of untyped nil
stdout
Standard output is empty