mirror of
https://github.com/spf13/cobra
synced 2025-05-06 13:27:26 +00:00
fix: defer licenseFile
This commit is contained in:
parent
891d81cc84
commit
7a0cf95b2a
1 changed files with 1 additions and 0 deletions
|
@ -75,6 +75,7 @@ func (p *Project) createLicenseFile() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
defer licenseFile.Close()
|
||||||
|
|
||||||
licenseTemplate := template.Must(template.New("license").Parse(p.Legal.Text))
|
licenseTemplate := template.Must(template.New("license").Parse(p.Legal.Text))
|
||||||
return licenseTemplate.Execute(licenseFile, data)
|
return licenseTemplate.Execute(licenseFile, data)
|
||||||
|
|
Loading…
Add table
Reference in a new issue