json
   
func (db database) ServeHTTP(w http.ResponseWriter,req *http.Request) {
//里面随便放数据
   w.Header().Add("Content-Type", "application/json")
   var dataMap map[string]interface{};
   multipartForm,_ := json.Marshal(dataMap)
   w.Write(multipartForm)

其实你可以用用好一点的go web 框架 比如 go iris Go Web Iris中文网