如何提取表单数据字段名称

My Go is acting as a router to direct url path to various projects.

What I've been trying to do is to get form data's field name,

Response from body:

----------------------------858963562546262475963074
Content-Disposition: form-data; name="name"

james
----------------------------858963562546262475963074
Content-Disposition: form-data; name="account"

admin
----------------------------858963562546262475963074

I'm able to get value by doing g.PostForm(), But I'm trying to get name field(name,account) to determine whether if params is given but content is empty

Clearly you should parse your data as Multipart form data. Please check multipart package that should fit your need. multipart package documentation

I've found a solution to related question.

Solution:

g.Request.ParseMultipartForm(128)
getForm := g.Request.MultipartForm

Retrieving value in "map": getForm.Value