package httpUtil

import (
	"html/template"
	"net/http"
)

//Render 渲染html 返回渲染后的html
func Render(w http.ResponseWriter, tmp string, data *map[string]interface{}) error {
	t, err := template.ParseFiles(tmp)
	if err != nil {
		return err
	}
	err = t.Execute(w, data)
	if err != nil {
		return err
	}
	return nil
}
