code: func ToPagesGroup(seq interface{}) (PagesGroup, error) {
  	switch v := seq.(type) {
  	case nil:
  		return nil, nil
  	case PagesGroup:
  		return v, nil
  	case []PageGroup:
  		return PagesGroup(v), nil
  	case []interface{}:
  		l := len(v)
  		if l == 0 {
  			break
  		}
  		switch v[0].(type) {
  		case PageGroup:
  			pagesGroup := make(PagesGroup, l)
  			for i, ipg := range v {
  				if pg, ok := ipg.(PageGroup); ok {
  					pagesGroup[i] = pg
  				} else {
  					return nil, fmt.Errorf("unsupported type in paginate from slice, got %T instead of PageGroup", ipg)
  				}
  			}
  			return pagesGroup, nil
  		}
  	}
  
  	return nil, nil
  }
docs: // ToPagesGroup tries to convert seq into a PagesGroup.