lxc/config/remote.go
func (c *Config) ParseRemote(raw string) (string, string, error) {
	result := strings.SplitN(raw, ":", 2)
	if len(result) == 1 {
		return c.DefaultRemote, raw, nil
	}

	_, ok := c.Remotes[result[0]]
	if !ok {
		// Attempt to play nice with snapshots containing ":"
		if shared.IsSnapshot(raw) && shared.IsSnapshot(result[0]) {
			return c.DefaultRemote, raw, nil
		}

		return "", "", fmt.Errorf("The remote \"%s\" doesn't exist", result[0])
	}

	return result[0], result[1], nil
}
func (c *Config) ParseRemote(raw string) (string, string, error) {
	result := strings.SplitN(raw, ":", 2)
	if len(result) == 1 {
		return c.DefaultRemote, raw, nil
	}

	_, ok := c.Remotes[result[0]]
	if !ok {
		// Attempt to play nice with snapshots containing ":"
		if shared.IsSnapshot(raw) && shared.IsSnapshot(result[0]) {
			return c.DefaultRemote, raw, nil
		}

		return "", "", fmt.Errorf("The remote \"%s\" doesn't exist", result[0])
	}

	return result[0], result[1], nil
}
func ( c * Config ) ParseRemote ( raw string ) ( string , string , error ) { result := strings . SplitN ( raw , " " , 2 ) if len ( result ) == 1 { return c . DefaultRemote , raw , nil } _ , ok := c . Remotes [ result [ 0 ] ] if ! ok { // Attempt to play nice with snapshots containing ":" if shared . IsSnapshot ( raw ) && shared . IsSnapshot ( result [ 0 ] ) { return c . DefaultRemote , raw , nil } return " " , " " , fmt . Errorf ( " \" \" " , result [ 0 ] ) } return result [ 0 ] , result [ 1 ] , nil }
// ParseRemote splits remote and object
ParseRemote splits remote and object