diff --git a/src/device/input/raw/raw.go b/src/device/input/raw/raw.go index cbc89ab..2c7eb21 100644 --- a/src/device/input/raw/raw.go +++ b/src/device/input/raw/raw.go @@ -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) diff --git a/src/main.go b/src/main.go index 657d20c..a660707 100644 --- a/src/main.go +++ b/src/main.go @@ -17,7 +17,7 @@ func Main(ctx context.Context) error { defer reader.Close() interval := time.Millisecond * 50 - if intervalS, ok := os.LookupEnv("MAIN_INTERVAL_DURATION"); !ok { + if intervalS := os.Getenv("MAIN_INTERVAL_DURATION"); intervalS != "" { } else if v, err := time.ParseDuration(intervalS); err != nil { panic(err) } else {