diff --git a/examples/execing-processes/execing-processes.go b/examples/execing-processes/execing-processes.go index 7ac83008c..4898430f7 100644 --- a/examples/execing-processes/execing-processes.go +++ b/examples/execing-processes/execing-processes.go @@ -13,7 +13,8 @@ package main import ( "os" "os/exec" - "syscall" + + "golang.org/x/sys/unix" ) func main() { @@ -38,12 +39,12 @@ func main() { // environment. env := os.Environ() - // Here's the actual `syscall.Exec` call. If this call is + // Here's the actual `unix.Exec` call. If this call is // successful, the execution of our process will end // here and be replaced by the `/bin/ls -a -l -h` // process. If there is an error we'll get a return // value. - execErr := syscall.Exec(binary, args, env) + execErr := unix.Exec(binary, args, env) if execErr != nil { panic(execErr) } diff --git a/examples/execing-processes/execing-processes.hash b/examples/execing-processes/execing-processes.hash index 90bd32578..291103201 100644 --- a/examples/execing-processes/execing-processes.hash +++ b/examples/execing-processes/execing-processes.hash @@ -1,2 +1,2 @@ -568ae983493addff02d2ce8df57f41daf537f077 -s9qg7olf1dM +08296102ec7720e560f4e1eb7554e73f01553a92 +m9u7-JZeKF3 diff --git a/examples/signals/signals.go b/examples/signals/signals.go index f90682ec0..25fbd7cef 100644 --- a/examples/signals/signals.go +++ b/examples/signals/signals.go @@ -11,14 +11,15 @@ import ( "context" "fmt" "os/signal" - "syscall" + + "golang.org/x/sys/unix" ) func main() { // `signal.NotifyContext` returns a context that's canceled // when one of the listed signals arrives. ctx, stop := signal.NotifyContext( - context.Background(), syscall.SIGINT, syscall.SIGTERM) + context.Background(), unix.SIGINT, unix.SIGTERM) defer stop() // The program will wait here until one of the diff --git a/examples/signals/signals.hash b/examples/signals/signals.hash index 4424916ce..0932cc2a7 100644 --- a/examples/signals/signals.hash +++ b/examples/signals/signals.hash @@ -1,2 +1,2 @@ -f55b2c52d8888d110d5909023e1dd8bfdf0846a6 -F3Wm7JT8wgn +f575622f0e0df24b2ac419e81027f099370996b0 +KyU6iGt3BmP diff --git a/go.mod b/go.mod index 477a32dc0..2d3692139 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( github.com/aws/aws-sdk-go-v2/config v1.19.1 github.com/aws/aws-sdk-go-v2/service/s3 v1.97.3 github.com/russross/blackfriday/v2 v2.1.0 + golang.org/x/sys v0.47.0 ) require ( diff --git a/go.sum b/go.sum index c737d0dbd..43e53d02f 100644 --- a/go.sum +++ b/go.sum @@ -58,5 +58,7 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= +golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/public/execing-processes b/public/execing-processes index 095a478db..0922cd19c 100644 --- a/public/execing-processes +++ b/public/execing-processes @@ -52,7 +52,7 @@ function.

+ 
package main
import (
"os"
- "os/exec"
- "syscall"
+ "os/exec"
+
+
+
+ "golang.org/x/sys/unix"
)
Here’s the actual syscall.Exec call. If this call is
+
Here’s the actual unix.Exec call. If this call is
successful, the execution of our process will end
here and be replaced by the /bin/ls -a -l -h
process. If there is an error we’ll get a return
@@ -136,7 +145,7 @@ value.
execErr := syscall.Exec(binary, args, env)
+ execErr := unix.Exec(binary, args, env)
if execErr != nil {
panic(execErr)
}
@@ -192,7 +201,7 @@ processes covers most use cases for fork.