aboutsummaryrefslogtreecommitdiffstats
path: root/misc/random_bugs/main.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-08-19 21:26:35 +0200
committerMichael Muré <batolettre@gmail.com>2018-08-19 21:26:35 +0200
commit285e8394861765757a057ca1e16c36c9ca8227cb (patch)
treebdde8de002723f6ce43ef8088dbf4981a15b339b /misc/random_bugs/main.go
parent08127d8d1ce1b0e4f4a15b05a240bbd421f559a0 (diff)
downloadgit-bug-285e8394861765757a057ca1e16c36c9ca8227cb.tar.gz
random_bugs: make it seedable and reusable
Diffstat (limited to 'misc/random_bugs/main.go')
-rw-r--r--misc/random_bugs/main.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/misc/random_bugs/main.go b/misc/random_bugs/main.go
new file mode 100644
index 00000000..7211548e
--- /dev/null
+++ b/misc/random_bugs/main.go
@@ -0,0 +1,28 @@
+// +build ignore
+
+package main
+
+import (
+ "os"
+
+ rb "github.com/MichaelMure/git-bug/misc/random_bugs"
+ "github.com/MichaelMure/git-bug/repository"
+)
+
+// This program will randomly generate a collection of bugs in the repository
+// of the current path
+func main() {
+ dir, err := os.Getwd()
+ if err != nil {
+ panic(err)
+ }
+
+ repo, err := repository.NewGitRepo(dir, func(repo *repository.GitRepo) error {
+ return nil
+ })
+ if err != nil {
+ panic(err)
+ }
+
+ rb.GenerateRandomBugs(repo, rb.DefaultOptions())
+}