// GetExits will return the exits recorded on the error if any are found.
162272
func GetExits(err error) string {
	if err == nil {
		return ""
	}
	cast, ok := err.(*Error)
	if !ok {
		return ""
	}
	return cast.Exits()
}
607722
func (s *DB) GetErrors() []error {
	if errs, ok := s.Error.(Errors); ok {
		return errs
	} else if s.Error != nil {
		return []error{s.Error}
	}
	return []error{}
}
462744
func (c *CommitStats) GetDeletions() int {
	if c == nil || c.Deletions == nil {
		return 0
	}
	return *c.Deletions
}
536137
func (c *client) GetEntries(key string) ([]string, error) {
	resp, err := c.keysAPI.Get(c.ctx, key, &etcd.GetOptions{Recursive: true})
	if err != nil {
		return nil, err
	}

	// Special case. Note that it's possible that len(resp.Node.Nodes) == 0 and
	// resp.Node.Value is also empty, in which case the key is empty and we
	// should not return any entries.
	if len(resp.Node.Nodes) == 0 && resp.Node.Value != "" {
		return []string{resp.Node.Value}, nil
	}

	entries := make([]string, len(resp.Node.Nodes))
	for i, node := range resp.Node.Nodes {
		entries[i] = node.Value
	}
	return entries, nil
}
1131013
func GetExitStatus(err error) (int, error) {
	if err == nil {
		return 0, nil
	}
	if exiterr, ok := err.(*exec.ExitError); ok {
		// the program has exited with an exit code != 0
		if status, ok := exiterr.Sys().(syscall.WaitStatus); ok {
			return status.ExitStatus(), nil
		}
	}
	return -1, err
}
648282
func (c *Client) GetSnapshots() (snapshotList []Snapshot, err error) {
	var snapshotMap map[string]Snapshot
	if err := c.get(`snapshot/list`, &snapshotMap); err != nil {
		return nil, err
	}

	for _, snapshot := range snapshotMap {
		snapshotList = append(snapshotList, snapshot)
	}
	sort.Sort(snapshots(snapshotList))
	return snapshotList, nil
}
840594
func (c *CommandContext) UsageExit() {
	fmt.Println(c.cmd.Keyword)
	fmt.Println(c.cmd.Usage)
	os.Exit(0)
}
313157
func exit(code int) {
	for _, fn := range atExit {
		if err := fn(); err != nil {
			fmt.Fprintln(os.Stderr, "atExit:", err)
		}
	}
	os.Exit(code)
}
1087020
func getFiles(paths []string, globs []string) []file {
	var fs []file
	for _, p := range paths {
		for _, g := range globs {
			ms, _ := filepath.Glob(filepath.Join(p, g))
			for _, m := range ms {
				r, err1 := filepath.Rel(p, m)
				fi, err2 := os.Stat(m)
				if err1 == nil && err2 == nil && !fi.IsDir() {
					fs = append(fs, file{Abs: m, Rel: r})
				}
			}
		}
	}
	return fs
}
649613
func (e *ControlleeExpectations) GetExpectations() (int64, int64) {
	return atomic.LoadInt64(&e.add), atomic.LoadInt64(&e.del)
}
750348
func (c *Conn) GetStreams() []inet.Stream {
	c.streams.Lock()
	defer c.streams.Unlock()
	streams := make([]inet.Stream, 0, len(c.streams.m))
	for s := range c.streams.m {
		streams = append(streams, s)
	}
	return streams
}
186577
func getExtensions(migrationsDir string) ([]string, error) {
	contents, err := ioutil.ReadFile(filepath.Join(migrationsDir, extensionsFileName))
	if err != nil {
		if os.IsNotExist(err) {
			return nil, nil
		}
		return nil, err
	}
	extensions := strings.Split(string(contents), "\n")
	sanitizedExtensions := make([]string, 0)
	for _, extension := range extensions {
		sanitized := strings.TrimSpace(extension)
		if sanitized != "" {
			sanitizedExtensions = append(sanitizedExtensions, extension)
		}
	}
	return sanitizedExtensions, nil
}
283851
func (f *RegexFilter) GetFilters() map[string]*regexp.Regexp {
	f.mu.RLock()
	ret := f.currentFilters
	f.mu.RUnlock()
	return ret
}
1129040
func (p *PullRequest) GetDeletions() int {
	if p == nil || p.Deletions == nil {
		return 0
	}
	return *p.Deletions
}
414026
func (scanner *Scanner) GetTokens() (tokens []string, err error) {
	tokens, _, err = scanner.getTokens(0)
	return
}
185105
func (a *api) GetSnapshots() ([]dao.SnapshotInfo, error) {
	services, err := a.GetAllServiceDetails()
	if err != nil {
		return nil, err
	}

	// Get only unique snapshots as defined by the tenant ID
	svcmap := NewServiceMap(services)
	var snapshots []dao.SnapshotInfo
	for _, s := range svcmap.Tree()[""] {
		ss, err := a.GetSnapshotsByServiceID(s)
		if err != nil {
			return nil, fmt.Errorf("error trying to retrieve snapshots for service %s: %s", s, err)
		}
		snapshots = append(snapshots, ss...)
	}

	return snapshots, nil
}
1295420
func GetExtraFlags() []cli.Flag {
	return []cli.Flag{
		cli.BoolFlag{
			Name:  "auto-fork",
			Usage: "Enable auto-fork of background service.",
		},
		cli.BoolFlag{
			Name:  "no-auto-fork, F",
			Usage: "Disable auto-fork of background service.",
		},
	}
}