I am a beginner with go-lang. I met a problem when I uploaded a file with html template. I google a lot but not solved.
<input type="file" name="myfile"/>
Use func (*Request) FormFile get the file.
file, header, err := req.FormFile("receipt")
But how to validate the file whether it is empty from server side? I know I can read request.Body to find whether myfile is empty.
Is there a better way to implement it?