can exit while reading from keyboard

This commit is contained in:
Bel LaPointe
2023-03-02 15:21:34 -07:00
parent 5c5a371f55
commit b0767818e2
6 changed files with 22 additions and 11 deletions

View File

@@ -10,9 +10,10 @@ import (
)
func Main(ctx context.Context) error {
reader := input.New()
writer := output.New()
reader := input.New(ctx)
writer := output.New(ctx)
defer writer.Close()
defer reader.Close()
interval := time.Millisecond * 50
if intervalS, ok := os.LookupEnv("MAIN_INTERVAL_DURATION"); !ok {