Golang mime/multipart.Form.RemoveAll() function example

package mime/multipart

Golang mime/multipart.Form.RemoveAll() function usage example

 func handler(w http.ResponseWriter, r *http.Request) {

 formdata := r.MultipartForm 

 if formdata==nil {
 fmt.Println("no files uploaded!")
 } else {
 defer formdata.RemoveAll()
 }

 }

Reference :

http://golang.org/pkg/mime/multipart/#Form.RemoveAll

Advertisement