buffer blocks while no changes underlying, test buffer

This commit is contained in:
Bel LaPointe
2023-03-02 15:17:01 -07:00
parent bfdab392a0
commit 5c5a371f55
3 changed files with 39 additions and 1 deletions

View File

@@ -12,5 +12,9 @@ func New() Input {
if p, ok := os.LookupEnv("INPUT_RANDOM_WEIGHT_FILE"); ok {
foo = randomCharFromWeightFile(p)
}
return NewRandom(foo)
var result Input = NewRandom(foo)
if os.Getenv("INPUT_BUFFERED") == "true" {
result = NewBuffered(result)
}
return result
}