diff --git a/godoc/static/makestatic.go b/godoc/static/makestatic.go index 3886eb28..9cc69e38 100644 --- a/godoc/static/makestatic.go +++ b/godoc/static/makestatic.go @@ -15,6 +15,7 @@ import ( "go/format" "io/ioutil" "os" + "time" "unicode/utf8" ) @@ -84,7 +85,7 @@ func makestatic() error { } defer f.Close() buf := new(bytes.Buffer) - fmt.Fprintf(buf, "%v\npackage static\n\n", warning) + fmt.Fprintf(buf, "%v\n\n%v\n\npackage static\n\n", license, warning) fmt.Fprintf(buf, "var Files = map[string]string{\n") for _, fn := range files { b, err := ioutil.ReadFile(fn) @@ -119,4 +120,8 @@ func sanitize(b []byte) []byte { return bytes.Replace(b, []byte("\xEF\xBB\xBF"), []byte("`+\"\\xEF\\xBB\\xBF\"+`"), -1) } -const warning = "// Code generated by \"makestatic\"; DO NOT EDIT\n" +const warning = `// Code generated by "makestatic"; DO NOT EDIT` + +var license = fmt.Sprintf(`// Copyright %d 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.`, time.Now().UTC().Year()) diff --git a/godoc/static/static.go b/godoc/static/static.go index 5855c1db..a4286609 100644 --- a/godoc/static/static.go +++ b/godoc/static/static.go @@ -1,3 +1,7 @@ +// Copyright 2017 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. + // Code generated by "makestatic"; DO NOT EDIT package static