{ http.HandleFunc("/device_status", radiusAccountHandler) err := http.ListenAndServe(":8000", nil) } func radiusAccountHandler(w http.ResponseWriter, r *http.Request) { // 处理请求 fmt.Fprintf(w, "ok") go sendAccountToInst(r) }
实际上 执行sendAccountToInst函数时, 传入的参数r 值都为空。此时将go sendAccountToInst(r)改为 sendAccountToInst(r)就正常
什么原因?