// Get returns the URIs in the 'accept list' of the given type.
Get returns the URIs in the 'accept list' of the given type.
// Get returns the URIs in the ' accept list ' of the given type .
func (m *Manager) Get(acceptType string) ([]*url.URL, error) {
	if acceptType == "" {
		return nil, errors.New("type is required")
	}
	lists, err := m.queryByType(acceptType)
	if err != nil {
		return nil, fmt.Errorf("query by type: %w", err)
	}
	if len(lists) == 0 {
		return nil, nil
	}
	acceptList := lists[0]
	if acceptList.Type != acceptType {
		return nil, fmt.Errorf("expecting result of type [%s] but got type [%s]",
			acceptType, acceptList.Type)
	}
	return acceptList.URL, nil
}
func ( m * Manager ) Get ( acceptType string ) ( [ ] * url . URL , error ) { if acceptType == " " { return nil , errors . New ( " " ) } lists , err := m . queryByType ( acceptType ) if err != nil { return nil , fmt . Errorf ( " " , err ) } if len ( lists ) == 0 { return nil , nil } acceptList := lists [ 0 ] if acceptList . Type != acceptType { return nil , fmt . Errorf ( " " , acceptType , acceptList . Type ) } return acceptList . URL , nil }
Get returns the URIs in the 'accept list' of the given type.
Get returns the URIs in the ' accept list ' of the given type .