Skip to content
Myr

vgo - add command working

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by jharshman · committed by Steve Francia · parent 3c42f84 · Browse files · 2 files+4 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+4 added−3 removed

  • other:+4 added−3 removed

2 files+4 added−3 removed

modified:cobra/cmd/project.go+2 added-1 removed
96 unmodified lines
97 }98 defer cmdFile.Close()99100 commandTemplate := template.Must(template.New("sub").Parse(string(tpl.AddCommandTemplate())))101 err = commandTemplate.Execute(cmdFile, c.Project.AbsolutePath)101 err = commandTemplate.Execute(cmdFile, c)102 if err != nil {103 return err104 }105 return nil106}107108// NewProject returns Project with specified project name.109func NewProject(projectName string) *Project {
180 unmodified lines
modified:cobra/tpl/main.go+2 added-2 removed
108 unmodified lines
109}110111func AddCommandTemplate() []byte {112 return []byte(`/*113{{ .Copyright }}114{{ if .Legal.Header }}{{ .Legal.Header }}{{ end }}113{{ .Project.Copyright }}114{{ if .Project.Legal.Header }}{{ .Project.Legal.Header }}{{ end }}115*/116package cmd117118import (
35 unmodified lines