<commit_before>package zkill

import (
	"fmt"
	"strconv"
	"time"
)

// Historical returns all kill ID's and their accompanying hashes submittted to
// zKillboard on the provided date.
func (client *Client) Historical(date time.Time) (killmails map[int]string, err error) {
	// TODO
	results := make(map[string]string)
	client.fetch(fmt.Sprintf("/history/%v/", date.Format("20060102")), &results)
	var id int
	for key, val := range results {
		if id, err = strconv.Atoi(key); err != nil {
			err = fmt.Errorf("unable to convert string value '%v' to type int: %v", key, err)
			return
		} else {
			killmails[id] = val
		}
	}
	return
}<commit_msg>fixed bug where Client.Historical would panic over assignment to nil map<commit_after>package zkill

import (
	"fmt"
	"strconv"
	"time"
)

// Historical returns all kill ID's and their accompanying hashes submittted to
// zKillboard on the provided date.
func (client *Client) Historical(date time.Time) (killmails map[int]string, err error) {
	killmails = make(map[int]string)
	results := make(map[string]string)
	client.fetch(fmt.Sprintf("/history/%v/", date.Format("20060102")), &results)
	var id int
	for key, val := range results {
		if id, err = strconv.Atoi(key); err != nil {
			err = fmt.Errorf("unable to convert string value '%v' to type int: %v", key, err)
			return
		} else {
			killmails[id] = val
		}
	}
	return
}
{'fraction_non_alphanumeric': 0.13537117903930132, 'fraction_numerical': 0.011644832605531296, 'mean_word_length': 4.07380073800738, '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': '5352189', 'n_tokens_mistral': 505, 'n_tokens_neox': 465, 'n_words': 149}