.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.1.1-0.20210319172145-bda8f5cee399 / godoc / static / makestatic.go
1 // Copyright 2013 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 //go:build ignore
6 // +build ignore
7
8 // Command makestatic writes the generated file buffer to "static.go".
9 // It is intended to be invoked via "go generate" (directive in "gen.go").
10 package main
11
12 import (
13         "fmt"
14         "io/ioutil"
15         "os"
16
17         "golang.org/x/tools/godoc/static"
18 )
19
20 func main() {
21         if err := makestatic(); err != nil {
22                 fmt.Fprintln(os.Stderr, err)
23                 os.Exit(1)
24         }
25 }
26
27 func makestatic() error {
28         buf, err := static.Generate()
29         if err != nil {
30                 return fmt.Errorf("error while generating static.go: %v\n", err)
31         }
32         err = ioutil.WriteFile("static.go", buf, 0666)
33         if err != nil {
34                 return fmt.Errorf("error while writing static.go: %v\n", err)
35         }
36         return nil
37 }