<commit_before>package main

import (
	"bufio"
	"fmt"
	"io"
	"os"

	"github.com/crgimenes/goconfig"
)

type config struct {
	FileName string `cfg:"name"`
}

var memory [640000]byte

func main() {
	cfg := config{}

	goconfig.PrefixEnv = "R86"
	err := goconfig.Parse(&cfg)
	if err != nil {
		println(err.Error())
		os.Exit(1)
	}

	if cfg.FileName == "" {
		if len(os.Args) > 1 {
			cfg.FileName = os.Args[len(os.Args)-1]
		}
	}

	f, err := os.Open(cfg.FileName)
	if err != nil {
		println(err.Error())
		os.Exit(1)
	}

	defer func() {
		err = f.Close()
		if err != nil {
			println(err.Error())
			os.Exit(1)
		}
	}()

	buff := bufio.NewReader(f)

	var c byte
	var count int
	var col int
	//var row int

	count = 0x100
	for {

		c, err = buff.ReadByte()<commit_msg>add closer function<commit_after>package main

import (
	"bufio"
	"fmt"
	"io"
	"os"

	"github.com/crgimenes/goconfig"
)

type config struct {
	FileName string `cfg:"name"`
}

var memory [640000]byte

func closer(f io.Closer) {
	err := f.Close()
	if err != nil {
		println(err.Error())
	}
}

func main() {
	cfg := config{}

	goconfig.PrefixEnv = "R86"
	err := goconfig.Parse(&cfg)
	if err != nil {
		println(err.Error())
		os.Exit(1)
	}

	if cfg.FileName == "" {
		if len(os.Args) > 1 {
			cfg.FileName = os.Args[len(os.Args)-1]
		}
	}

	f, err := os.Open(cfg.FileName)
	if err != nil {
		println(err.Error())
		os.Exit(1)
	}

	defer closer(f)

	buff := bufio.NewReader(f)

	var c byte
	var count int
	var col int
	//var row int

	count = 0x100
	for {

		c, err = buff.ReadByte()
{'fraction_non_alphanumeric': 0.1719662556781311, 'fraction_numerical': 0.021414665801427646, 'mean_word_length': 2.933673469387755, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7256814', 'n_tokens_mistral': 720, 'n_tokens_neox': 657, 'n_words': 151}