Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.0.1-2020.1.5 / internal / gosmith / gosmith.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/internal/gosmith/gosmith.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/internal/gosmith/gosmith.go
new file mode 100644 (file)
index 0000000..bff8ad4
--- /dev/null
@@ -0,0 +1,28 @@
+package main
+
+import (
+       "flag"
+       "fmt"
+       "math/rand"
+       "os"
+)
+
+var (
+       seed       = flag.Int64("seed", 0, "random generator seed")
+       workdir    = flag.String("dir", "", "directory to write the program to")
+       singlepkg  = flag.Bool("singlepkg", false, "generate single-package program")
+       singlefile = flag.Bool("singlefile", false, "generate single-file packages")
+)
+
+func main() {
+       flag.Parse()
+       if *workdir == "" {
+               fmt.Fprintf(os.Stderr, "-dir flag is missing\n")
+               os.Exit(1)
+       }
+       rand.Seed(*seed)
+       smith := &Smith{
+               rng: rand.New(rand.NewSource(*seed)),
+       }
+       smith.writeProgram(*workdir)
+}