Skip to content

Commit 8da61ae

Browse files
Added error handling for template parsing to make gosec happy
1 parent d22bb84 commit 8da61ae

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

plugin/plugin.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ func UsageCommandString(cmd *cobra.Command) string {
115115
usage := template.New("usage")
116116
usage.Funcs(templateFuncs)
117117
template.Must(usage.Parse(USEAGE_TEMPLATE))
118-
usage.Execute(&buf, cmd)
118+
err := usage.Execute(&buf, cmd)
119+
if err != nil {
120+
return err.Error()
121+
}
119122
return buf.String()
120123
}
121124

0 commit comments

Comments
 (0)