// Write implements ResultWriter.Write.
Write implements ResultWriter.Write.
// Write implements ResultWriter . Write .
func (rw *JSONResultWriter) Write(result *CheckerResult, statusCode int, w http.ResponseWriter, r *http.Request) error {
	jsonResp, err := json.Marshal(result)
	if err != nil {
		return fmt.Errorf("cannot marshal response: %w", err)
	}
	w.Header().Set("Content-Type", "application/json; charset=utf-8")
	w.WriteHeader(statusCode)
	_, err = w.Write(jsonResp)
	return err
}
func ( rw * JSONResultWriter ) Write ( result * CheckerResult , statusCode int , w http . ResponseWriter , r * http . Request ) error { jsonResp , err := json . Marshal ( result ) if err != nil { return fmt . Errorf ( " " , err ) } w . Header ( ) . Set ( " " , " " ) w . WriteHeader ( statusCode ) _ , err = w . Write ( jsonResp ) return err }
Write implements ResultWriter.Write.
Write implements ResultWriter . Write .