<commit_before>package viron

import "fmt"

const ParseErrorFormat = "%s value \"%s\" could not be parsed into %s value"

type ParseError string

func NewParseError(name, value, kind string) ParseError {
    return ParseError(fmt.Sprintf(ParseErrorFormat, name, value, kind))
}

func (err ParseError) Error() string {
    return string(err)
}

type InvalidArgumentError string

func NewInvalidArgumentError(value interface{}) InvalidArgumentError {
    return InvalidArgumentError(fmt.Sprintf("%v is not a non-zero struct pointer", value))
}

func (err InvalidArgumentError) Error() string {
    return string(err)
}

type RequiredFieldError string

func NewRequiredFieldError(name string) RequiredFieldError {
    return RequiredFieldError(fmt.Sprintf("%s is a required environment variable", name))
}

func (err RequiredFieldError) Error() string {
    return string(err)
}<commit_msg>Moves error format strings into const values<commit_after>package viron

import "fmt"

const (
    ParseErrorFormat           = "%s value \"%s\" could not be parsed into %s value"
    InvalidArgumentErrorFormat = "%v is not a non-zero struct pointer"
    RequiredFieldErrorFormat   = "%s is a required environment variable"
)

type ParseError string

func NewParseError(name, value, kind string) ParseError {
    return ParseError(fmt.Sprintf(ParseErrorFormat, name, value, kind))
}

func (err ParseError) Error() string {
    return string(err)
}

type InvalidArgumentError string

func NewInvalidArgumentError(value interface{}) InvalidArgumentError {
    return InvalidArgumentError(fmt.Sprintf(InvalidArgumentErrorFormat, value))
}

func (err InvalidArgumentError) Error() string {
    return string(err)
}

type RequiredFieldError string

func NewRequiredFieldError(name string) RequiredFieldError {
    return RequiredFieldError(fmt.Sprintf(RequiredFieldErrorFormat, name))
}

func (err RequiredFieldError) Error() string {
    return string(err)
}
{'fraction_non_alphanumeric': 0.0865533230293663, 'fraction_numerical': 0.0, 'mean_word_length': 5.284789644012945, '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': '848577', 'n_tokens_mistral': 523, 'n_tokens_neox': 521, 'n_words': 174}