flusher, ok := w.(http.Flusher)


// w.wr is io.Writer here


for _, gateway := range app.Gateway {


 go func(w http.ResponseWriter) {

    // w.wr is nil here


    tmpl, err := template.New(gateway.Name).Parse(gateway.Content)
  
    if err != nil {
       panic("An Error occured when parsing html")
       return
    }

    tmpl.Execute(w, "")
 
    defer flusher.Flush()
 }()


}


Why w.wr is nil inside the function ? When i use function as non routine it 
works fine but i want to use the function as go routine.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f167b667-fb31-4c20-bf44-f6a114b21c62%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to