<commit_before># Experiment

Experiment is a Go package to test and evaluate new code paths without
interfering with the users end result.

This is inspired by the [GitHub Scientist gem](https://github.com/github/scientist).

## Usage

```go
func main() {
    exp := experiment.New(
        experiment.Name("my-test"),
        experiment.Enabled(shouldRunTest),
        experiment.Percentage(10),
        experiment.Compare(comparisonMethod),
    )
    exp.Control(func() interface{} {
        return "my-text"
    })
    exp.Test(func() interface{} {
        buf := bytes.NewBufferString("")
        buf.WriteString("new")
        buf.Write([]byte(`-`))
        buf.WriteString("text")

        return string(buf.Bytes())
    })

    exp.Run()
}

func shouldRunTest() bool {
    return os.Getenv("ENV") == "prod"
}

func comparisonMethod(control interface{}, test interface{}) bool {
    c := control.(string)
    t := test.(string)

    return c == t
}
```<commit_msg>Readme: proper go indentation.<commit_after># Experiment

Experiment is a Go package to test and evaluate new code paths without
interfering with the users end result.

This is inspired by the [GitHub Scientist gem](https://github.com/github/scientist).

## Usage

```go
func main() {
    exp, err := experiment.New(
        experiment.Name("my-test"),
        experiment.Enabled(shouldRunTest()),
        experiment.Percentage(10),
        experiment.Compare(comparisonMethod),
    )
    if err != nil {
        fmt.Println(err)
        return
    }

	exp.Control(func() interface{} {
		return "my-text"
	})
	exp.Test(func() interface{} {
		buf := bytes.NewBufferString("")
		buf.WriteString("new")
		buf.Write([]byte(`-`))
		buf.WriteString("text")

		return string(buf.Bytes())
	})

	exp.Run()
}

func shouldRunTest() bool {
	return os.Getenv("ENV") == "prod"
}

func comparisonMethod(control interface{}, test interface{}) bool {
	c := control.(string)
	t := test.(string)

	return c == t
}
```
{'fraction_non_alphanumeric': 0.15040650406504066, 'fraction_numerical': 0.0020325203252032522, 'mean_word_length': 3.1452631578947368, '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': '1128811', 'n_tokens_mistral': 622, 'n_tokens_neox': 600, 'n_words': 153}