feat: apply ignores from .gitignore/.ignore files
1 file changed, 34 insertions(+), 0 deletions(-)
changed files
A testcases/runaway/runaway.go
@@ -0,0 +1,34 @@ +package main + +import ( + "context" + "fmt" + "os" + "os/exec" + "os/signal" + "syscall" + "time" +) + +func main() { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + signal.NotifyContext(ctx, os.Interrupt, syscall.SIGHUP) + + cmd := exec.CommandContext(ctx, "sleep", "5") + + go func() { + for { + time.Sleep(5 * time.Second) + fmt.Println("I'm still alive!") + } + }() + + if err := cmd.Start(); err != nil { + panic("Error starting command: " + err.Error()) + } + + if err := cmd.Wait(); err != nil { + fmt.Printf("Error waiting for command: %v\n", err) + } +}