// ReadListItem recursively read a list item and the next potential item
434423
func ReadListItem(r *bufio.Reader) Value {
	ReadWhitespace(r)
	val, end := ReadValue(r)
	if end {
		return Snil{}
	}
	return Cons{val, ReadListItem(r)}
}
1009815
func listDirectories(path string) ([]string, error) {
	names := []string{}
	items, err := ioutil.ReadDir(path)
	if err != nil {
		return names, err
	}

	for _, item := range items {
		// We only want directories
		if item.IsDir() {
			currentDir := filepath.Join(path, item.Name())
			names = append(names, currentDir)

			// Do some recursion
			subNames, err := listDirectories(currentDir)
			if err == nil {
				names = append(names, subNames...)
			}
		}
	}

	return names, nil
}
95115
func (c *CloudPersister) ListItemTypes() ([]*types.ItemType, error) {
	ctx := context.Background()
	ItemTypes := make([]*types.ItemType, 0)
	q := datastore.NewQuery("ItemType")

	keys, err := c.DatastoreClient().GetAll(ctx, q, &ItemTypes)

	if err != nil {
		return nil, fmt.Errorf("datastoredb: could not list ItemTypes: %v", err)
	}

	for i, k := range keys {
		ItemTypes[i].ID = k.ID()
	}

	return ItemTypes, nil
}
352759
func (l *List) ReadFrom(r io.Reader) (n int64, err error) {
	var nn int64

	// Read TagType
	nn, err = l.Typ.ReadFrom(r)
	if err != nil {
		return
	}
	n += nn

	// Read length-prefix
	var length Int32
	nn, err = length.ReadFrom(r)
	if err != nil {
		return
	}
	n += nn

	// Read list items
	if length.Int32 > 0 {
		l.Value = make([]Tag, length.Int32)
		for index, elem := range l.Value {
			elem = l.Typ.New()
			nn, err = elem.ReadFrom(r)
			if err != nil {
				return
			}
			l.Value[index] = elem
			n += nn
		}

	}

	return
}
1132193
func (lw *ListWatch) List(options api.ListOptions) (runtime.Object, error) {
	return lw.ListFunc(options)
}
60625
func (c *Files) ListFolder(in *ListFolderInput) (out *ListFolderOutput, err error) {
	in.Path = normalizePath(in.Path)

	body, err := c.call("/files/list_folder", in)
	if err != nil {
		return
	}
	defer body.Close()

	err = json.NewDecoder(body).Decode(&out)
	return
}
72042
func (li *MemberListIterator) Next(ctx context.Context, items *[]Member) bool {
	if li.err != nil {
		return false
	}
	li.err = li.fetch(ctx, li.Paging.Next)
	if li.err != nil {
		return false
	}
	*items = li.Lists
	if len(li.Lists) == 0 {
		return false
	}
	return true
}
831878
func (s *ActivitiesResponse) SetItem(v []*ActivityResponse) *ActivitiesResponse {
	s.Item = v
	return s
}
834972
func NewListFolderResult(Entries []IsMetadata, Cursor string, HasMore bool) *ListFolderResult {
	s := new(ListFolderResult)
	s.Entries = Entries
	s.Cursor = Cursor
	s.HasMore = HasMore
	return s
}
50757
func (c *Cache) GetItem(key string) (it Item, ok bool) {
	c.Lock()
	defer c.Unlock()
	if it, ok := c.getItemPtr(key); ok {
		return *it, true
	}
	return
}
1118175
func LenList(list runtime.Object) int {
	itemsPtr, err := GetItemsPtr(list)
	if err != nil {
		return 0
	}
	items, err := conversion.EnforcePtr(itemsPtr)
	if err != nil {
		return 0
	}
	return items.Len()
}
1073205
func (p *pktline) readPacketList() ([]string, error) {
	var list []string
	for {
		data, err := p.readPacketText()
		if err != nil {
			return nil, err
		}

		if len(data) == 0 {
			break
		}

		list = append(list, data)
	}

	return list, nil
}
300999
func (li *ListsIterator) Next(ctx context.Context, items *[]MailingList) bool {
	if li.err != nil {
		return false
	}
	li.err = li.fetch(ctx, li.Paging.Next)
	if li.err != nil {
		return false
	}
	cpy := make([]MailingList, len(li.Items))
	copy(cpy, li.Items)
	*items = cpy
	if len(li.Items) == 0 {
		return false
	}
	return true
}
290191
func blocklistItem(name string) string {
	base := filepath.Base(name)

	for _, p := range prefixBlocklist {
		if strings.HasPrefix(base, p) {
			return p
		}
	}

	return ""
}
844299
func NewItemsItem(in interface{}, context *compiler.Context) (*ItemsItem, error) {
	errors := make([]error, 0)
	x := &ItemsItem{}
	m, ok := compiler.UnpackMap(in)
	if !ok {
		message := fmt.Sprintf("has unexpected value for item array: %+v (%T)", in, in)
		errors = append(errors, compiler.NewError(context, message))
	} else {
		x.Schema = make([]*Schema, 0)
		y, err := NewSchema(m, compiler.NewContext("<array>", context))
		if err != nil {
			return nil, err
		}
		x.Schema = append(x.Schema, y)
	}
	return x, compiler.NewErrorGroupOrNil(errors)
}
62470
func (k *SimpleFS) SimpleFSListRecursive(ctx context.Context, arg keybase1.SimpleFSListRecursiveArg) error {
	return k.startAsync(ctx, arg.OpID, keybase1.AsyncOps_LIST_RECURSIVE,
		keybase1.NewOpDescriptionWithListRecursive(
			keybase1.ListArgs{
				OpID: arg.OpID, Path: arg.Path, Filter: arg.Filter,
			}),
		k.listRecursiveToDepth(arg.OpID, arg.Path, arg.Filter, -1, arg.RefreshSubscription),
	)
}
664093
func (l *List) AddItems(items ...string) {
	l.items = append(l.items, items...)
}