Example #1
0
File: repo.go Project: e8vm/shanhu
func (r *repo) pkgDeps() (interface{}, error) {
	g, err := godep.PkgDep(r.pkgs)
	if err != nil {
		return nil, err
	}

	g, err = g.Rename(r.trimPath)
	if err != nil {
		return nil, err
	}
	m, err := dagvis.Layout(g)
	if err != nil {
		return nil, err
	}
	return dagvis.JSONMap(m), nil
}
Example #2
0
func (p *project) buildPkgDep(pkgs []string) interface{} {
	g, e := godep.PkgDep(pkgs)
	if p.err(e) {
		return nil
	}

	g, e = g.Rename(p.trimPath)
	if p.err(e) {
		return nil
	}

	m, e := dagvis.Layout(g)
	if p.err(e) {
		return nil
	}

	return dagvis.JSONMap(m)
}