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.
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").
17 "golang.org/x/tools/godoc/static"
21 if err := makestatic(); err != nil {
22 fmt.Fprintln(os.Stderr, err)
27 func makestatic() error {
28 buf, err := static.Generate()
30 return fmt.Errorf("error while generating static.go: %v\n", err)
32 err = ioutil.WriteFile("static.go", buf, 0666)
34 return fmt.Errorf("error while writing static.go: %v\n", err)