// ResolvedReaders returns the handle's resolved reader IDs in sorted
// order. If the handle is public, nil will be returned.
769301
func (h Handle) ResolvedReaders() []keybase1.UserOrTeamID {
	readers := h.unsortedResolvedReaders()
	sort.Sort(tlf.UIDList(readers))
	return readers
}
474447
func (env *Env) MaxReaders() (int, error) {
	var max C.uint
	ret := C.mdb_env_get_maxreaders(env._env, &max)
	return int(max), operrno("mdb_env_get_maxreaders", ret)
}
715238
func (col *Column) ResolveIndices(schema *Schema) (Expression, error) {
	newCol := col.Clone()
	err := newCol.resolveIndices(schema)
	return newCol, err
}
927533
func (s *Schema) ResolveRefs(loadExternal bool) {
	s.resolveSelfAndBelow(*s, *s, loadExternal)
}
687342
func newReader(ctx context.Context, d *dispatcher, r io.ReadCloser) *reader {
	return &reader{
		ctx: ctx,
		d:   d,
		r:   r,
	}
}
1335573
func FilterRead(r io.Reader, filter func(int, []byte) error) error {
	return Filter(r, nil, false, func(linenum int, line []byte) ([]byte, error) {
		return nil, filter(linenum, line)
	})
}
1206747
func NewReadArgs(handle StreamHandle) *ReadArgs {
	args := new(ReadArgs)
	args.Handle = handle
	return args
}
1266746
func (b *XMLBase) resolveAttrs(p *xpp.XMLPullParser) error {
	for i, attr := range p.Attrs {
		lowerName := strings.ToLower(attr.Name.Local)
		if b.URIAttrs[lowerName] {
			absURL, err := b.ResolveURL(attr.Value)
			if err != nil {
				return err
			}
			p.Attrs[i].Value = absURL
		}
	}
	return nil
}
707507
func (s *File) NewReader(id string) (io.ReadCloser, error) {
	return os.OpenFile(s.join(s.Prefixed.Name(id)), os.O_RDONLY, 0400)
}
182417
func readRequestHeaders(
	ctx context.Context,
	format tchannel.Format,
	getReader func() (tchannel.ArgReader, error),
) (context.Context, transport.Headers, error) {
	headers, err := readHeaders(format, getReader)
	if err != nil {
		return ctx, headers, err
	}
	return ctx, headers, nil
}
740399
func (conn *gdbConn) readRegisters(threadID string, data []byte) error {
	if !conn.threadSuffixSupported {
		if err := conn.selectThread('g', threadID, "registers read"); err != nil {
			return err
		}
	}
	conn.outbuf.Reset()
	conn.outbuf.WriteString("$g")
	conn.appendThreadSelector(threadID)
	resp, err := conn.exec(conn.outbuf.Bytes(), "registers read")
	if err != nil {
		return err
	}

	for i := 0; i < len(resp); i += 2 {
		n, _ := strconv.ParseUint(string(resp[i:i+2]), 16, 8)
		data[i/2] = uint8(n)
	}

	return nil
}
609612
func (m *Discriminator) ResolveReferences(root string) (interface{}, error) {
	errors := make([]error, 0)
	if m.Mapping != nil {
		_, err := m.Mapping.ResolveReferences(root)
		if err != nil {
			errors = append(errors, err)
		}
	}
	return nil, compiler.NewErrorGroupOrNil(errors)
}
1017581
func resolvePids() ([]int, error) {
	// If pgrep isn't available, this will just bail out and the user will be
	// required to specify a pid.
	output, err := pgrep()
	if err != nil {
		switch err.(type) {
		case *exec.ExitError:
			// ExitError indicates non-zero exit code, meaning no processes
			// found.
			break
		default:
			return nil, errors.New("unable to resolve pid, try providing one")
		}
	}
	var (
		myPid   = os.Getpid()
		pidStrs = strings.Split(string(output), "\n")
		pids    = make([]int, 0, len(pidStrs))
	)
	for _, pidStr := range pidStrs {
		if pidStr == "" {
			continue
		}
		pid, err := strconv.Atoi(pidStr)
		if err != nil {
			return nil, errors.New("unable to resolve pid, try providing one")
		}
		// Ignore the current process.
		if pid == myPid {
			continue
		}
		pids = append(pids, pid)
	}
	return pids, nil
}
229987
func (f ResolverFunc) ResolveProviders(reqd discovery.PluginRequirements) (map[string]Factory, []error) {
	return f(reqd)
}
703070
func (rld *ReadersAndUpdates) dropReaders() error {
	rld.Lock()
	defer rld.Unlock()

	// TODO: can we somehow use IOUtils here...?
	// problem is we are calling .decRef not .close)...
	err := func() (err error) {
		defer func() {
			if rld.mergeReader != nil {
				log.Printf("  pool.drop info=%v merge rc=%v", rld.info, rld.mergeReader.refCount)
				defer func() { rld.mergeReader = nil }()
				err2 := rld.mergeReader.decRef()
				if err == nil {
					err = err2
				} else {
					log.Printf("Escaped error: %v", err2)
				}
			}
		}()

		if rld._reader != nil {
			log.Printf("  pool.drop info=%v merge rc=%v", rld.info, rld._reader.refCount)
			defer func() { rld._reader = nil }()
			return rld._reader.decRef()
		}
		return nil
	}()
	if err != nil {
		return err
	}
	rld.decRef()
	return nil
}
375021
func (cc *ClientConn) waitForResolvedAddrs(ctx context.Context) error {
	// This is on the RPC path, so we use a fast path to avoid the
	// more-expensive "select" below after the resolver has returned once.
	if cc.firstResolveEvent.HasFired() {
		return nil
	}
	select {
	case <-cc.firstResolveEvent.Done():
		return nil
	case <-ctx.Done():
		return status.FromContextError(ctx.Err()).Err()
	case <-cc.ctx.Done():
		return ErrClientConnClosing
	}
}
84681
func (m *Responses) ResolveReferences(root string) (interface{}, error) {
	errors := make([]error, 0)
	for _, item := range m.ResponseCode {
		if item != nil {
			_, err := item.ResolveReferences(root)
			if err != nil {
				errors = append(errors, err)
			}
		}
	}
	for _, item := range m.VendorExtension {
		if item != nil {
			_, err := item.ResolveReferences(root)
			if err != nil {
				errors = append(errors, err)
			}
		}
	}
	return nil, compiler.NewErrorGroupOrNil(errors)
}