<commit_before>package goat

import (
	"encoding/json"
	"log"
)

// GetFilesJSON returns a JSON representation of one or more FileRecords
func GetFilesJSON(ID int, resChan chan []byte) {
	// Check for a valid integer ID
	if ID > 0 {
		// Load file
		file := new(FileRecord).Load(ID, "id")

		// Marshal into JSON
		res, err := json.Marshal(file)
		if err != nil {
			log.Println(err.Error())
			resChan <- nil
		}

		// Return status
		resChan <- res
	}

	resChan <- nil
}<commit_msg>Make GetFilesJSON return after sending on channel<commit_after>package goat

import (
	"encoding/json"
	"log"
)

// GetFilesJSON returns a JSON representation of one or more FileRecords
func GetFilesJSON(ID int, resChan chan []byte) {
	// Check for a valid integer ID
	if ID > 0 {
		// Load file
		file := new(FileRecord).Load(ID, "id")

		// Marshal into JSON
		res, err := json.Marshal(file)
		if err != nil {
			log.Println(err.Error())
			resChan <- nil
			return
		}

		// Return status
		resChan <- res
		return
	}

	resChan <- nil
	return
}
{'fraction_non_alphanumeric': 0.12027158098933075, 'fraction_numerical': 0.0019398642095053346, 'mean_word_length': 2.9389312977099236, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, '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': '2921568', 'n_tokens_mistral': 399, 'n_tokens_neox': 344, 'n_words': 115}