// ServeJSON sends json data to the client
ServeJSON sends json data to the client
// ServeJSON sends json data to the client
func ServeJSON(w http.ResponseWriter, data interface{}) {
	buf := &bytes.Buffer{}
	err := json.NewEncoder(buf).Encode(data)
	if err != nil {
		ServeInternalServerError(w)
	}
	w.Header().Set("Content-Type", "application/json")
	_, err = io.Copy(w, buf)
	if err != nil {
		log.Println(err)
	}
}
func ServeJSON ( w http . ResponseWriter , data interface { } ) { buf := & bytes . Buffer { } err := json . NewEncoder ( buf ) . Encode ( data ) if err != nil { ServeInternalServerError ( w ) } w . Header ( ) . Set ( " " , " " ) _ , err = io . Copy ( w , buf ) if err != nil { log . Println ( err ) } }
ServeJSON sends json data to the client
ServeJSON sends json data to the client