<commit_before>package main

import (
	"io/ioutil"
	"log"
	"net/http"
	"time"
)

const (
	userAgentHeader  = "User-Agent"
	defaultUserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; +https://github.com/thekvs/yandex-ddns)"
)

const defaultNetworkTimeout = 20 * time.Second

var client = &http.Client{Timeout: defaultNetworkTimeout}

func getURL(url string) []byte {
	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		log.Fatalf("error: '%v'\n", err)
	}

	req.Header.Add(userAgentHeader, defaultUserAgent)

	resp, err := client.Do(req)
	if err != nil {
		log.Fatalf("error: '%v'\n", err)
	}
	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		log.Fatalf("error: '%v'\n", err)
	}

	return body
}<commit_msg>check HTTP response status code<commit_after>package main

import (
	"io/ioutil"
	"log"
	"net/http"
	"time"
)

const (
	userAgentHeader  = "User-Agent"
	defaultUserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; +https://github.com/thekvs/yandex-ddns)"
)

const defaultNetworkTimeout = 20 * time.Second

var client = &http.Client{Timeout: defaultNetworkTimeout}

func getURL(url string) []byte {
	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		log.Fatalf("error: '%v'\n", err)
	}

	req.Header.Add(userAgentHeader, defaultUserAgent)

	resp, err := client.Do(req)
	if err != nil {
		log.Fatalf("error: '%v'\n", err)
	}
	if resp.StatusCode != 200 {
		log.Fatalf("error: unexpecetd HTTP status code: %d\n", resp.StatusCode)
	}
	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		log.Fatalf("error: '%v'\n", err)
	}

	return body
}
{'fraction_non_alphanumeric': 0.17160493827160495, 'fraction_numerical': 0.009259259259259259, 'mean_word_length': 4.065625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '7412155', 'n_tokens_mistral': 655, 'n_tokens_neox': 638, 'n_words': 140}