Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.0.0-20201105173854-bc9fc8d8c4bc / godoc / static / makestatic.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.0.0-20201105173854-bc9fc8d8c4bc/godoc/static/makestatic.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.0.0-20201105173854-bc9fc8d8c4bc/godoc/static/makestatic.go
new file mode 100644 (file)
index 0000000..0f910f0
--- /dev/null
@@ -0,0 +1,36 @@
+// Copyright 2013 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build ignore
+
+// Command makestatic writes the generated file buffer to "static.go".
+// It is intended to be invoked via "go generate" (directive in "gen.go").
+package main
+
+import (
+       "fmt"
+       "io/ioutil"
+       "os"
+
+       "golang.org/x/tools/godoc/static"
+)
+
+func main() {
+       if err := makestatic(); err != nil {
+               fmt.Fprintln(os.Stderr, err)
+               os.Exit(1)
+       }
+}
+
+func makestatic() error {
+       buf, err := static.Generate()
+       if err != nil {
+               return fmt.Errorf("error while generating static.go: %v\n", err)
+       }
+       err = ioutil.WriteFile("static.go", buf, 0666)
+       if err != nil {
+               return fmt.Errorf("error while writing static.go: %v\n", err)
+       }
+       return nil
+}