mirror of
https://github.com/securego/gosec.git
synced 2025-07-09 00:45:40 +02:00
add CommandContext as subprocess launcher
This commit is contained in:
@ -408,6 +408,20 @@ func main() {
|
||||
log.Printf("Command finished with error: %v", err)
|
||||
}`, 1}, {`
|
||||
package main
|
||||
import (
|
||||
"log"
|
||||
"os/exec"
|
||||
"context"
|
||||
)
|
||||
func main() {
|
||||
err := exec.CommandContext(context.Background(), "sleep", "5").Run()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
log.Printf("Command finished with error: %v", err)
|
||||
}
|
||||
}`, 1}, {`
|
||||
package main
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
|
Reference in New Issue
Block a user