func sendResponse(w http.ResponseWriter, httpStatusCode int, payload interface{}) {
	w.WriteHeader(httpStatusCode)

	enc := json.NewEncoder(w)
	err := enc.Encode(payload)
	if err != nil {
		log.Error().Err(err).Msgf("could not encode json response: %v", err)
	}
}
// sendResponse converts raw objects and parameters to a json response
// and passes it to a provided writer.
sendResponse converts raw objects and parameters to a json response
and passes it to a provided writer.
// sendResponse converts raw objects and parameters to a json response // and passes it to a provided writer .
func sendResponse(w http.ResponseWriter, httpStatusCode int, payload interface{}) {
	w.WriteHeader(httpStatusCode)
	enc := json.NewEncoder(w)
	err := enc.Encode(payload)
	if err != nil {
		log.Error().Err(err).Msgf("could not encode json response: %v", err)
	}
}
func sendResponse ( w http . ResponseWriter , httpStatusCode int , payload interface { } ) { w . WriteHeader ( httpStatusCode ) enc := json . NewEncoder ( w ) err := enc . Encode ( payload ) if err != nil { log . Error ( ) . Err ( err ) . Msgf ( " " , err ) } }
sendResponse converts raw objects and parameters to a json response
and passes it to a provided writer.
sendResponse converts raw objects and parameters to a json response and passes it to a provided writer .