Files
podman/test/goecho/goecho.go
Paul Holzinger 8631032556 run modernize -fix ./...
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>
2025-09-10 16:17:04 +02:00

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)
}