w.Write([]byte(result))
http.ServeFile(w, r, "form-3-2.html")
The reason for that warning is these two lines. The first line writes
some data to the response, which also forces the response writer to
write HTTP response headers, which at this point are empty. Then,
ServeFile sets some headers, and then writes those headers again,
thinking this is the first time the response was written. But the
headers are already written to the response, so the headers set by the
ServeFile function is lost. That's the reason you get that warning.
You should not set headers after you start writing the body.
You seem to be trying to add a piece of text to an html file. Instead
of doing it as you do, try using templates.
>
> Any help is appreciated.
> Thank you very much!
> Max
>
> --
> 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.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/5e7457cf-119b-4be5-adc8-a94317fc837f%40googlegroups.com.