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.
7 // Command makestatic writes the generated file buffer to "static.go".
8 // It is intended to be invoked via "go generate" (directive in "gen.go").
16 "golang.org/x/tools/godoc/static"
20 if err := makestatic(); err != nil {
21 fmt.Fprintln(os.Stderr, err)
26 func makestatic() error {
27 buf, err := static.Generate()
29 return fmt.Errorf("error while generating static.go: %v\n", err)
31 err = ioutil.WriteFile("static.go", buf, 0666)
33 return fmt.Errorf("error while writing static.go: %v\n", err)