vgo - add command working

This commit is contained in:
jharshman 2019-01-30 01:44:39 -08:00 committed by Steve Francia
parent 3c42f846c2
commit 2fea75b02e
2 changed files with 4 additions and 3 deletions

View File

@ -98,10 +98,11 @@ func (c *Command) Create() error {
defer cmdFile.Close()
commandTemplate := template.Must(template.New("sub").Parse(string(tpl.AddCommandTemplate())))
err = commandTemplate.Execute(cmdFile, c.Project.AbsolutePath)
err = commandTemplate.Execute(cmdFile, c)
if err != nil {
return err
}
return nil
}
// NewProject returns Project with specified project name.

View File

@ -110,8 +110,8 @@ func initConfig() {
func AddCommandTemplate() []byte {
return []byte(`/*
{{ .Copyright }}
{{ if .Legal.Header }}{{ .Legal.Header }}{{ end }}
{{ .Project.Copyright }}
{{ if .Project.Legal.Header }}{{ .Project.Legal.Header }}{{ end }}
*/
package cmd