mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-09 09:26:54 +00:00
27 lines
370 B
Go
27 lines
370 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"flag"
|
||
|
"fmt"
|
||
|
"os"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
sleep := flag.Duration("sleep", 0, "Sleep")
|
||
|
warn := flag.Bool("warn", false, "Warn")
|
||
|
fail := flag.Int("fail", 0, "Fail with code")
|
||
|
flag.Parse()
|
||
|
|
||
|
if *sleep != 0 {
|
||
|
time.Sleep(*sleep)
|
||
|
}
|
||
|
|
||
|
fmt.Println("this is stdout")
|
||
|
if *warn {
|
||
|
fmt.Fprintln(os.Stderr, "this is stderr")
|
||
|
}
|
||
|
|
||
|
os.Exit(*fail)
|
||
|
}
|