<commit_before>package typetalk

import (
	"errors"
	"github.com/Sirupsen/logrus"
	"net/http"
	"net/url"
)

const (
	VERISON = "1.0.0"
)

type TypetalkHook struct {
	AcceptedLevels []logrus.Level
	BotURL         string
}

func (th *TypetalkHook) Levels() []logrus.Level {
	if th.AcceptedLevels == nil {
		return AllLevels
	}
	return th.AcceptedLevels
}

func (th *TypetalkHook) Fire(e *logrus.Entry) error {
	resp, err := http.PostForm(th.BotURL, url.Values{"message": {e.Message}})
	if err != nil {
		return err
	}
	if resp.StatusCode != http.StatusOK {
		return errors.New(e.Message)
	}
	return nil
}<commit_msg>Add closing HTTP response body<commit_after>package typetalk

import (
	"errors"
	"github.com/Sirupsen/logrus"
	"net/http"
	"net/url"
)

const (
	VERISON = "1.0.0"
)

type TypetalkHook struct {
	AcceptedLevels []logrus.Level
	BotURL         string
}

func (th *TypetalkHook) Levels() []logrus.Level {
	if th.AcceptedLevels == nil {
		return AllLevels
	}
	return th.AcceptedLevels
}

func (th *TypetalkHook) Fire(e *logrus.Entry) error {
	resp, err := http.PostForm(th.BotURL, url.Values{"message": {e.Message}})
	if err != nil {
		return err
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		return errors.New(e.Message)
	}
	return nil
}
{'fraction_non_alphanumeric': 0.13858267716535433, 'fraction_numerical': 0.004724409448818898, 'mean_word_length': 3.8143939393939394, 'pattern_counts': {'":': 2, '<': 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': '5657535', 'n_tokens_mistral': 518, 'n_tokens_neox': 500, 'n_words': 110}