func (daemon *Daemon) FindNetwork(idName string) (libnetwork.Network, error) {
	// Find by Name
	n, err := daemon.GetNetwork(idName, NetworkByName)
	if _, ok := err.(libnetwork.ErrNoSuchNetwork); err != nil && !ok {
		return nil, err
	}

	if n != nil {
		return n, nil
	}

	// Find by id
	n, err = daemon.GetNetwork(idName, NetworkByID)
	if err != nil {
		return nil, err
	}

	return n, nil
}
// FindNetwork function finds a network for a given string that can represent network name or id
FindNetwork function finds a network for a given string that can represent network name or id
// FindNetwork function finds a network for a given string that can represent network name or id
func (daemon *Daemon) FindNetwork(idName string) (libnetwork.Network, error) {
	n, err := daemon.GetNetwork(idName, NetworkByName)
	if _, ok := err.(libnetwork.ErrNoSuchNetwork); err != nil && !ok {
		return nil, err
	}
	if n != nil {
		return n, nil
	}
	n, err = daemon.GetNetwork(idName, NetworkByID)
	if err != nil {
		return nil, err
	}
	return n, nil
}
func ( daemon * Daemon ) FindNetwork ( idName string ) ( libnetwork . Network , error ) { n , err := daemon . GetNetwork ( idName , NetworkByName ) if _ , ok := err . ( libnetwork . ErrNoSuchNetwork ) ; err != nil && ! ok { return nil , err } if n != nil { return n , nil } n , err = daemon . GetNetwork ( idName , NetworkByID ) if err != nil { return nil , err } return n , nil }
FindNetwork function finds a network for a given string that can represent network name or id
FindNetwork function finds a network for a given string that can represent network name or id
// Find by Name // Find by id