no lookup env

This commit is contained in:
bel
2023-03-25 10:20:05 -06:00
parent 2cae3c6d28
commit 2113252e2d
2 changed files with 2 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ func New(ctx context.Context) Raw {
return NewUDP(ctx, port)
}
generator := randomCharFromRange('a', 'g')
if p, ok := os.LookupEnv("RAW_RANDOM_WEIGHT_FILE"); ok && len(p) > 0 {
if p := os.Getenv("RAW_RANDOM_WEIGHT_FILE"); p != "" {
generator = randomCharFromWeightFile(p)
}
return NewRandom(generator)