// AddTextEntries allows adding multiple entries to a name in one call.
425148
func (n *Name) AddTextEntries(entries map[string]string) error {
	for f, v := range entries {
		if err := n.AddTextEntry(f, v); err != nil {
			return err
		}
	}
	return nil
}
668295
func WithLogEntries(msg string, err error, entries map[string][]string) {
	displayError(msg, err)

	for name, lines := range entries {
		console.OutStyle("failure", "Problems detected in %q:", name)
		if len(lines) > MaxLogEntries {
			lines = lines[:MaxLogEntries]
		}
		for _, l := range lines {
			console.OutStyle("log-entry", l)
		}
	}
	os.Exit(Software)
}
497393
func (s *DeleteMessageBatchInput) SetEntries(v []*DeleteMessageBatchRequestEntry) *DeleteMessageBatchInput {
	s.Entries = v
	return s
}
1216050
func (c *Client) AddLogEntry(ctx context.Context, k, v []byte, t time.Time) error {
	return c.db.Update(func(tx *bolt.Tx) error {
		return c.addLogEntry(ctx, tx, k, v, t)
	})
}
346937
func (cd CompactData) Entries() []CompactEntry {
	index := cd.Indexer()
	cols := cd.Columns()
	var entries []CompactEntry
	cd.Rows(func(i int, r Row) {
		entry := CompactEntry{}
		for _, c := range cols {
			val, ok := index(c, r)
			if !ok {
				continue // declared column wasn't included in DATA row!
			}
			entry[c] = val
		}
		entries = append(entries, entry)
	})
	return entries
}
704644
func (a *ACL) AddBaseEntries(path string) error {
	fi, err := os.Lstat(path)
	if err != nil {
		return err
	}
	mode := fi.Mode().Perm()
	var r, w, x bool

	// set USER_OBJ entry
	r = mode&userRead == userRead
	w = mode&userWrite == userWrite
	x = mode&userExec == userExec
	if err := a.addBaseEntryFromMode(TagUserObj, r, w, x); err != nil {
		return err
	}

	// set GROUP_OBJ entry
	r = mode&groupRead == groupRead
	w = mode&groupWrite == groupWrite
	x = mode&groupExec == groupExec
	if err := a.addBaseEntryFromMode(TagGroupObj, r, w, x); err != nil {
		return err
	}

	// set OTHER entry
	r = mode&otherRead == otherRead
	w = mode&otherWrite == otherWrite
	x = mode&otherExec == otherExec
	if err := a.addBaseEntryFromMode(TagOther, r, w, x); err != nil {
		return err
	}

	return nil
}
1177406
func (irt *immutableRangeTree) Add(entries ...Entry) *immutableRangeTree {
	if len(entries) == 0 {
		return irt
	}

	cache := newCache(irt.dimensions)
	top := make(orderedNodes, len(irt.top))
	copy(top, irt.top)
	added := uint64(0)
	for _, entry := range entries {
		irt.add(&top, cache, entry, &added)
	}

	tree := newImmutableRangeTree(irt.dimensions)
	tree.top = top
	tree.number = irt.number + added
	return tree
}
1072079
func (s *ChangeMessageVisibilityBatchInput) SetEntries(v []*ChangeMessageVisibilityBatchRequestEntry) *ChangeMessageVisibilityBatchInput {
	s.Entries = v
	return s
}
1248782
func IsEntry(name string, entries []string) bool {
	for _, e := range entries {
		if e == name {
			return true
		}
	}
	return false
}
930063
func (s *SimulatePrincipalPolicyInput) SetContextEntries(v []*ContextEntry) *SimulatePrincipalPolicyInput {
	s.ContextEntries = v
	return s
}
585683
func AddHostsEntry(filename string, ip string, hostname string) error {
	fp, err := os.OpenFile(filename, os.O_RDWR, 0644)
	if err != nil {
		return err
	}
	defer fp.Close()

	out := ""
	found := false

	scanner := bufio.NewScanner(fp)
	for scanner.Scan() {
		line := scanner.Text()
		words := strings.Fields(line)
		if !found && len(words) > 0 && words[0] == ip {
			found = true
			out += fmt.Sprintf("%s %s\n", line, hostname)
		} else {
			out += line
			out += "\n"
		}
	}
	if err := scanner.Err(); err != nil {
		return err
	}

	// If that IP was not found, add a new line
	if !found {
		out += fmt.Sprintf("%s\t%s\n", ip, hostname)
	}

	// Seek to the beginning, truncate, and write again
	if _, err := fp.Seek(0, 0); err != nil {
		return err
	}
	if err := fp.Truncate(0); err != nil {
		return err
	}
	if _, err := fp.Write([]byte(out)); err != nil {
		return err
	}

	return nil
}
566510
func (ot *orderedTree) add(entry Entry) *node {
	var node *node
	list := &ot.top

	for i := uint64(1); i <= ot.dimensions; i++ {
		if isLastDimension(ot.dimensions, i) {
			overwritten := list.add(
				newNode(entry.ValueAtDimension(i), entry, false),
			)
			if overwritten == nil {
				ot.number++
			}
			return overwritten
		}
		node, _ = list.getOrAdd(entry, i, ot.dimensions)
		list = &node.orderedNodes
	}

	return nil
}
512718
func (s *CreateAssociationBatchInput) SetEntries(v []*CreateAssociationBatchRequestEntry) *CreateAssociationBatchInput {
	s.Entries = v
	return s
}
669681
func (c *SimpleComponentMatcher) AddComponents(sc ...StaticComponent) {
	c.comp = append(c.comp, sc...)
}
205667
func NewInsertTextArgs(text string) *InsertTextArgs {
	args := new(InsertTextArgs)
	args.Text = text
	return args
}
6730
func (i IdentifierSet) AddIdentifiers(idents Identifiers) {
	for _, ident := range idents {
		i.Add(ident)
	}
}
1295545
func (runner *runner) AddEntry(entry string, set *IPSet, ignoreExistErr bool) error {
	args := []string{"add", set.Name, entry}
	if ignoreExistErr {
		args = append(args, "-exist")
	}
	if _, err := runner.exec.Command(IPSetCmd, args...).CombinedOutput(); err != nil {
		return fmt.Errorf("error adding entry %s, error: %v", entry, err)
	}
	return nil
}