示例#1
0
文件: project.go 项目: e8vm/shanhu
func (p *project) buildFileDeps(prog *goload.Program) map[string]interface{} {
	pkgDeps := godep.FileDepLoaded(prog)

	ret := make(map[string]interface{})
	for pkg, g := range pkgDeps {
		m, e := dagvis.Layout(g)
		if p.err(e) {
			continue
		}
		ret[pkg] = dagvis.JSONMap(m)
	}

	return ret
}
示例#2
0
文件: repo.go 项目: e8vm/shanhu
func (r *repo) fileDeps() (map[string]interface{}, []error) {
	deps := godep.FileDepLoaded(r.prog)

	var errs []error
	ret := make(map[string]interface{})
	for pkg, dep := range deps {
		m, err := dagvis.Layout(dep)
		if err != nil {
			errs = append(errs, err)
			continue
		}
		p, err := r.trimPath(pkg)
		if err != nil {
			errs = append(errs, err)
			continue
		}
		ret[p] = dagvis.JSONMap(m)
	}
	return ret, errs
}