From 3201e0a57d747a5c78cee7ea5754ef1831bc0c37 Mon Sep 17 00:00:00 2001 From: alan <652732310@qq.com> Date: Sat, 21 Sep 2024 23:36:47 +0800 Subject: [PATCH] handle Template.Execute error --- build/update-license.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/update-license.go b/build/update-license.go index f548a5995b..eb0f70e324 100644 --- a/build/update-license.go +++ b/build/update-license.go @@ -386,7 +386,10 @@ func writeLicense(info *info) { } // Construct new file content. 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 { buf.Write(content[:m[0]]) buf.Write(content[m[1]:])