I replace demo := HandlerFunc{} to var demo HandlerFunc also can not [john@localhost gweb]$ go run inspiration_by_golang_http.go panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x401035]
goroutine 1 [running]: panic(0x47a9a0, 0xc42000a090) /home/john/go/src/runtime/panic.go:500 +0x1a1 main.HandlerFunc.Call(0x0, 0x1, 0x2) /home/john/gweb/inspiration_by_golang_http.go:14 +0x35 main.main() /home/john/gweb/inspiration_by_golang_http.go:20 +0x40 exit status 2 Maube i can not imitate it 在 2016年12月4日星期日 UTC+8上午9:00:10,Sebastien Binet写道: > > Or just: > var demo HandlerFunc > ? > > -s > > sent from my droid > > On Dec 3, 2016 8:27 PM, "Tamás Gulácsi" <tgula...@gmail.com <javascript:>> > wrote: > >> demo := HandlerFunc(func(x,y int) {}) >> >> -- >> You received this message because you are subscribed to the Google Groups >> "golang-nuts" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to golang-nuts...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.