Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Description for npm install
- npm install
- #Description for test
- npm test
- #Description for test2
- run test2
- // example with switch
- func (d Dependency) TypeCommand() Command {
- switch d.Type {
- case "runner":
- cmd1 := Command{"#Description for npm install", "npm install"}
- cmd2 := Command{"#Description for test", "npm test"}
- cmd3 := Command{"#Description for test2", "run test2"}
- case "runner2":
- return "test 2"
- }
- return "command_baz"
- }
- **The template is:**
- const tmpl = `
- {{- range .File.Dependency}}
- {{.TypeCommand}}
- {{end}}`
- When I change the template for the following I got error:
- const tmpl = `
- {{- range .File.Dependency}}
- {{ TypeCommand .}}
- {{ range .Command}}
- {{ .Info }}
- {{ .Command }}
- {{end}}
- {{end}}
- '
Add Comment
Please, Sign In to add comment