1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00
wakapi/utils/template.go

15 lines
190 B
Go
Raw Normal View History

2020-02-20 16:28:55 +03:00
package utils
import (
"encoding/json"
"html/template"
)
func Json(data interface{}) template.JS {
d, err := json.Marshal(data)
if err != nil {
return ""
}
return template.JS(d)
}