mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
handle Template.Execute error
This commit is contained in:
parent
9326a118c7
commit
3201e0a57d
1 changed files with 4 additions and 1 deletions
|
|
@ -386,7 +386,10 @@ func writeLicense(info *info) {
|
||||||
}
|
}
|
||||||
// Construct new file content.
|
// Construct new file content.
|
||||||
buf := new(bytes.Buffer)
|
buf := new(bytes.Buffer)
|
||||||
licenseT.Execute(buf, info)
|
err = licenseT.Execute(buf, info)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("error applying template %s: %v\n", info.file, err)
|
||||||
|
}
|
||||||
if m := licenseCommentRE.FindIndex(content); m != nil && m[0] == 0 {
|
if m := licenseCommentRE.FindIndex(content); m != nil && m[0] == 0 {
|
||||||
buf.Write(content[:m[0]])
|
buf.Write(content[:m[0]])
|
||||||
buf.Write(content[m[1]:])
|
buf.Write(content[m[1]:])
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue