support $INPUT_REMAP_FILE
This commit is contained in:
@@ -12,7 +12,7 @@ type Input interface {
|
||||
|
||||
func New(ctx context.Context) Input {
|
||||
foo := randomCharFromRange('a', 'g')
|
||||
if p, ok := os.LookupEnv("INPUT_RANDOM_WEIGHT_FILE"); ok {
|
||||
if p, ok := os.LookupEnv("INPUT_RANDOM_WEIGHT_FILE"); ok && len(p) > 0 {
|
||||
foo = randomCharFromWeightFile(p)
|
||||
}
|
||||
var result Input = NewRandom(foo)
|
||||
@@ -22,5 +22,8 @@ func New(ctx context.Context) Input {
|
||||
if os.Getenv("INPUT_BUFFERED") == "true" {
|
||||
result = NewBuffered(ctx, result)
|
||||
}
|
||||
if p, ok := os.LookupEnv("INPUT_REMAP_FILE"); ok && len(p) > 0 {
|
||||
result = NewRemapFromFile(result, p)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user