зеркало из https://github.com/golang/tools.git
godoc/static: have makestatic use the same code header comment as stringer
This allows Github to hide diffs in generated files. See: https://github.com/github/linguist/blob/473282d/lib/linguist/generated.rb#L241 Change-Id: I0565c729dacfa7861e7da7eb66bc8021d191fc3e Reviewed-on: https://go-review.googlesource.com/15074 Reviewed-by: Andrew Gerrand <adg@golang.org>
This commit is contained in:
Родитель
2b5f3dc0de
Коммит
0f7bc42285
|
@ -84,7 +84,7 @@ func makestatic() error {
|
||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
w := bufio.NewWriter(f)
|
w := bufio.NewWriter(f)
|
||||||
fmt.Fprintf(w, "%v\n\npackage static\n\n", warning)
|
fmt.Fprintf(w, "%v\npackage static\n\n", warning)
|
||||||
fmt.Fprintf(w, "var Files = map[string]string{\n")
|
fmt.Fprintf(w, "var Files = map[string]string{\n")
|
||||||
for _, fn := range files {
|
for _, fn := range files {
|
||||||
b, err := ioutil.ReadFile(fn)
|
b, err := ioutil.ReadFile(fn)
|
||||||
|
@ -118,4 +118,4 @@ func sanitize(b []byte) []byte {
|
||||||
return bytes.Replace(b, []byte("\xEF\xBB\xBF"), []byte("`+\"\\xEF\\xBB\\xBF\"+`"), -1)
|
return bytes.Replace(b, []byte("\xEF\xBB\xBF"), []byte("`+\"\\xEF\\xBB\\xBF\"+`"), -1)
|
||||||
}
|
}
|
||||||
|
|
||||||
const warning = "// DO NOT EDIT ** This file was generated by \"go generate\" ** DO NOT EDIT //"
|
const warning = "// Code generated by \"makestatic\"; DO NOT EDIT\n"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// DO NOT EDIT ** This file was generated by "go generate" ** DO NOT EDIT //
|
// Code generated by "makestatic"; DO NOT EDIT
|
||||||
|
|
||||||
package static
|
package static
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче