func (r *Repository) RemoteURL(name string) (string, error) {
	config, err := os.Open(filepath.Join(r.path, "config"))
	if err != nil {
		return "", err
	}
	defer config.Close()
	line := fmt.Sprintf("[remote %q]", name)
	scanner := bufio.NewScanner(config)
	scanner.Split(bufio.ScanLines)
	for scanner.Scan() {
		if scanner.Text() == line {
			scanner.Scan()
			return strings.Split(scanner.Text(), " = ")[1], nil
		}
	}
	return "", errRemoteNotFound{name}
}
func (r *Repository) RemoteURL(name string) (string, error) {
	config, err := os.Open(filepath.Join(r.path, "config"))
	if err != nil {
		return "", err
	}
	defer config.Close()
	line := fmt.Sprintf("[remote %q]", name)
	scanner := bufio.NewScanner(config)
	scanner.Split(bufio.ScanLines)
	for scanner.Scan() {
		if scanner.Text() == line {
			scanner.Scan()
			return strings.Split(scanner.Text(), " = ")[1], nil
		}
	}
	return "", errRemoteNotFound{name}
}
func ( r * Repository ) RemoteURL ( name string ) ( string , error ) { config , err := os . Open ( filepath . Join ( r . path , " " ) ) if err != nil { return " " , err } defer config . Close ( ) line := fmt . Sprintf ( " " , name ) scanner := bufio . NewScanner ( config ) scanner . Split ( bufio . ScanLines ) for scanner . Scan ( ) { if scanner . Text ( ) == line { scanner . Scan ( ) return strings . Split ( scanner . Text ( ) , " " ) [ 1 ] , nil } } return " " , errRemoteNotFound { name } }
// RemoteURL returns the URL of a remote by its name. Or an error, if the
// remote is not declared.
RemoteURL returns the URL of a remote by its name . Or an error if the remote is not declared .