I do not write go, but it seems like your
func(w http.ResponseWriter
should be similar to
responseWriter.Header().Set("Content-Type", "application/json")
responseWriter.WriteHeader(http.StatusOK)
jsonData := []byte(`{}`)
responseWriter.Write(jsonData)