code: func (d *Downloader) DeduceRemoteRepo(path string, insecure bool) (vendor.RemoteRepo, string, error) {
  	cache := d.repos
  	if insecure {
  		cache = d.reposI
  	}
  
  	d.reposMu.RLock()
  	for p, repo := range cache {
  		if path == p || strings.HasPrefix(path, p+"/") {
  			d.reposMu.RUnlock()
  			extra := strings.Trim(strings.TrimPrefix(path, p), "/")
  			return repo, extra, nil
  		}
  	}
  	d.reposMu.RUnlock()
  
  	repo, extra, err := vendor.DeduceRemoteRepo(path, insecure)
  	if err != nil {
  		return repo, extra, err
  	}
  
  	if !strings.HasSuffix(path, extra) {
  		// Shouldn't happen, but in case just bypass the cache
  		return repo, extra, err
  	}
  	basePath := strings.Trim(strings.TrimSuffix(path, extra), "/")
  	d.reposMu.Lock()
  	cache[basePath] = repo
  	d.reposMu.Unlock()
  
  	return repo, extra, err
  }
docs: // DeduceRemoteRepo is a cached version of vendor.DeduceRemoteRepo