From a101d966133a70b8a76526be25070436d14fcf9f Mon Sep 17 00:00:00 2001 From: Rastislav Szabo Date: Thu, 4 May 2017 11:09:03 +0200 Subject: initial commit Signed-off-by: Rastislav Szabo --- .../onsi/gomega/gexec/_fixture/firefly/main.go | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 vendor/github.com/onsi/gomega/gexec/_fixture/firefly/main.go (limited to 'vendor/github.com/onsi/gomega/gexec/_fixture/firefly/main.go') diff --git a/vendor/github.com/onsi/gomega/gexec/_fixture/firefly/main.go b/vendor/github.com/onsi/gomega/gexec/_fixture/firefly/main.go new file mode 100644 index 0000000..16091c2 --- /dev/null +++ b/vendor/github.com/onsi/gomega/gexec/_fixture/firefly/main.go @@ -0,0 +1,36 @@ +package main + +import ( + "fmt" + "math/rand" + "os" + "strconv" + "time" +) + +var outQuote = "We've done the impossible, and that makes us mighty." +var errQuote = "Ah, curse your sudden but inevitable betrayal!" + +var randomQuotes = []string{ + "Can we maybe vote on the whole murdering people issue?", + "I swear by my pretty floral bonnet, I will end you.", + "My work's illegal, but at least it's honest.", +} + +func main() { + fmt.Fprintln(os.Stdout, outQuote) + fmt.Fprintln(os.Stderr, errQuote) + + randomIndex := rand.New(rand.NewSource(time.Now().UnixNano())).Intn(len(randomQuotes)) + + time.Sleep(100 * time.Millisecond) + + fmt.Fprintln(os.Stdout, randomQuotes[randomIndex]) + + if len(os.Args) == 2 { + exitCode, _ := strconv.Atoi(os.Args[1]) + os.Exit(exitCode) + } else { + os.Exit(randomIndex) + } +} -- cgit 1.2.3-korg