<commit_before>// Package notifier contains types and methods for sending notifications
// that a job has completed.
package notifier

import (
	"io"
	"io/ioutil"
	"fmt"
	"net/http"
)

// To create notifications, an object has to have a destination in mind
// and be able to serialize itself into a JSON message.
type Notifiable interface {
	Recipient() string
	Content() io.Reader
}

func SendNotification(n Notifiable) (response *http.Response, err error) {
	destination := n.Recipient()
	payload := n.Content()
	client := &http.Client{}
	req, _ := http.NewRequest("POST", destination, payload)
	req.SetBasicAuth("admin","password")
	req.Header.Set("Content-Type","application/json")
	response, err = client.Do(req)
	if err != nil {
		fmt.Println("Error posting notification:",err)
	}
	fmt.Println("Notification response:", response)
	body, err := ioutil.ReadAll(response.Body)
	response.Body.Close()
	fmt.Println("Notification response body:", string(body))
	return
}<commit_msg>Return if error<commit_after>// Package notifier contains types and methods for sending notifications
// that a job has completed.
package notifier

import (
	"io"
	"io/ioutil"
	"fmt"
	"net/http"
)

// To create notifications, an object has to have a destination in mind
// and be able to serialize itself into a JSON message.
type Notifiable interface {
	Recipient() string
	Content() io.Reader
}

func SendNotification(n Notifiable) (response *http.Response, err error) {
	destination := n.Recipient()
	payload := n.Content()
	client := &http.Client{}
	req, _ := http.NewRequest("POST", destination, payload)
	req.SetBasicAuth("admin","password")
	req.Header.Set("Content-Type","application/json")
	response, err = client.Do(req)
	if err != nil {
		fmt.Println("Error posting notification:",err)
		return
	}
	fmt.Println("Notification response:", response)
	body, err := ioutil.ReadAll(response.Body)
	response.Body.Close()
	fmt.Println("Notification response body:", string(body))
	return
}
{'fraction_non_alphanumeric': 0.13164556962025317, 'fraction_numerical': 0.0, 'mean_word_length': 4.880952380952381, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1960635', 'n_tokens_mistral': 613, 'n_tokens_neox': 600, 'n_words': 185}