Skip to content

Conversation

@Songmu
Copy link

@Songmu Songmu commented Jun 17, 2019

Using syscall.Exec makes the process tree simpler and is useful when you want the child process to handle the signal.

For example, the direnv program internally uses syscall.Exec.

https://github.com/direnv/direnv/blob/5b8f7d0ade4248e04899015e8628408b6f4becf3/cmd_exec.go#L67

How about it?

hoshsadiq added a commit to hoshsadiq/godotenv that referenced this pull request Nov 23, 2021
Using exec is better in this case as it makes the process tree simpler,
and allows the child's signals to be handled by the caller. In addition
the `Exec` function has been removed as it's not really great as a
library function. Users should manually call the `Load` function and
run `exec.Command` or `syscall.Exec` appropriately.

In the future we probably want to handle signals for Windows anyway.

This is based on joho/godotenv#77 and also
addresses the following PRs in upstream:

- joho/godotenv#119
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant