From 1e43a6a7e35b32a95b0c533d8b2d31f242e72463 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Thu, 16 Aug 2018 18:21:36 +0200 Subject: add a new main to generate random bugs --- vendor/github.com/icrowley/fake/products.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 vendor/github.com/icrowley/fake/products.go (limited to 'vendor/github.com/icrowley/fake/products.go') diff --git a/vendor/github.com/icrowley/fake/products.go b/vendor/github.com/icrowley/fake/products.go new file mode 100644 index 00000000..9c45fb3a --- /dev/null +++ b/vendor/github.com/icrowley/fake/products.go @@ -0,0 +1,26 @@ +package fake + +// Brand generates brand name +func Brand() string { + return Company() +} + +// ProductName generates product name +func ProductName() string { + productName := lookup(lang, "adjectives", true) + " " + lookup(lang, "nouns", true) + if r.Intn(2) == 1 { + productName = lookup(lang, "adjectives", true) + " " + productName + } + return productName +} + +// Product generates product title as brand + product name +func Product() string { + return Brand() + " " + ProductName() +} + +// Model generates model name that consists of letters and digits, optionally with a hyphen between them +func Model() string { + seps := []string{"", " ", "-"} + return CharactersN(r.Intn(3)+1) + seps[r.Intn(len(seps))] + Digits() +} -- cgit