fork download
  1. package main
  2.  
  3. func test(xPtr *int) {
  4. *xPtr = 0
  5. }
  6.  
  7. func main(){
  8. test(nil)
  9. }
Runtime error #stdin #stdout #stderr 0s 421248KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x8048c19]

goroutine 1 [running]:
main.main()
	/home/c8yn5l/prog.go:8 +0x19

goroutine 2 [syscall]:
created by runtime.main
	/usr/local/go/src/pkg/runtime/proc.c:221