Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
53 lines (46 sloc) 1.34 KB
package main
import (
var format string
var cmdList = &cmd.Command{
Name: "list",
UsageLine: "list [-f format]",
Short: "lists dependencies, one per line",
Long: `gb vendor list formats lists the contents of the manifest file.
The output
controls the template used for printing each manifest entry. If not supplied
the default value is "{{.Importpath}}\t{{.Repository}}{{.Path}}\t{{.Branch}}\t{{.Revision}}"
Run: func(ctx *gb.Context, args []string) error {
m, err := vendor.ReadManifest(manifestFile(ctx))
if err != nil {
return errors.Wrap(err, "could not load manifest")
tmpl, err := template.New("list").Parse(format)
if err != nil {
return errors.Wrapf(err, "unable to parse template %q", format)
w := tabwriter.NewWriter(os.Stdout, 1, 2, 1, ' ', 0)
for _, dep := range m.Dependencies {
if err := tmpl.Execute(w, dep); err != nil {
return errors.Wrap(err, "unable to execute template")
return w.Flush()
AddFlags: func(fs *flag.FlagSet) {
fs.StringVar(&format, "f", "{{.Importpath}}\t{{.Repository}}{{.Path}}\t{{.Branch}}\t{{.Revision}}", "format template")