mirror of
https://github.com/containers/podman.git
synced 2025-09-20 11:13:54 +08:00

Using golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize + some manual cleanup in libpod/lock/shm/shm_lock_test.go as it generated an unused variable + restored one removed comment Signed-off-by: Paul Holzinger <pholzing@redhat.com>
30 lines
413 B
Go
30 lines
413 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"strconv"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
args := os.Args[1:]
|
|
exitCode := 0
|
|
|
|
for i := range args {
|
|
fmt.Fprintln(os.Stdout, args[i])
|
|
fmt.Fprintln(os.Stderr, args[i])
|
|
}
|
|
|
|
if len(args) > 1 {
|
|
num, _ := strconv.Atoi(args[1])
|
|
if args[0] == "exitcode" {
|
|
exitCode = num
|
|
}
|
|
if args[0] == "sleep" {
|
|
time.Sleep(time.Duration(num) * time.Second)
|
|
}
|
|
}
|
|
os.Exit(exitCode)
|
|
}
|