Пример #1
0
// Vcs returns the VCS type to fetch source from.
func (d *Dependency) Vcs() string {
	var r string

	if d.Repository != "" {
		r = d.Repository
	} else {
		r = "https://" + d.Name
	}

	f, _, nv := mirrors.Get(r)
	if f {
		return nv
	}

	return d.VcsType
}
Пример #2
0
// Remote returns the remote location to fetch source from. This location is
// the central place where mirrors can alter the location.
func (d *Dependency) Remote() string {
	var r string

	if d.Repository != "" {
		r = d.Repository
	} else {
		r = "https://" + d.Name
	}

	f, nr, _ := mirrors.Get(r)
	if f {
		return nr
	}

	return r
}