// GetGOPATHs returns all paths in GOPATH variable.
483615
func GetGOPATHs() []string {
	gopath := os.Getenv("GOPATH")
	var paths []string
	if runtime.GOOS == "windows" {
		gopath = strings.Replace(gopath, "\\", "/", -1)
		paths = strings.Split(gopath, ";")
	} else {
		paths = strings.Split(gopath, ":")
	}
	return paths
}
1224934
func (g *Generator) getLocalizedPath(path string) string {
	if strings.HasSuffix(path, ".go") {
		path, _ = filepath.Split(path)
	}
	if localized, ok := g.localizationCache[path]; ok {
		return localized
	}
	directories := strings.Split(path, string(filepath.Separator))
	numDirectories := len(directories)
	vendorIndex := -1
	for i := 1; i <= numDirectories; i++ {
		dir := directories[numDirectories-i]
		if dir == "vendor" {
			vendorIndex = numDirectories - i
			break
		}
	}

	toReturn := path
	if vendorIndex >= 0 {
		toReturn = filepath.Join(directories[vendorIndex+1:]...)
	} else if filepath.IsAbs(path) {
		toReturn = calculateImport(g.packageRoots, path)
	}

	// Enforce '/' slashes for import paths in every OS.
	toReturn = filepath.ToSlash(toReturn)

	g.localizationCache[path] = toReturn
	return toReturn
}
418947
func (l *LargeFile) GetPath() string {
	if l == nil || l.Path == nil {
		return ""
	}
	return *l.Path
}
149136
func (v *Value) getPath(keys []string) (*Value, error) {
	current := v
	var err error
	for _, key := range keys {
		current, err = current.get(key)

		if err != nil {
			return nil, err
		}
	}
	return current, nil
}
172515
func (c *Client) GetRegions() ([]Region, error) {
	var regionMap map[string]Region
	if err := c.get(`regions/list`, &regionMap); err != nil {
		return nil, err
	}

	var regionList []Region
	for _, os := range regionMap {
		regionList = append(regionList, os)
	}
	sort.Sort(regions(regionList))
	return regionList, nil
}
566189
func GOPath(repourl string) (w string) {
	var e []string
	repourl = FullGOPath(repourl)
	if e = strings.Split(repourl, "/"); len(e) < 3 {
		return ""
	}
	return e[0] + "/" + e[1] + "/" + e[2]
}
69802
func (l *ActionListener) GetPath(nodes ...string) string {
	return actionPath(append([]string{l.hostID}, nodes...)...)
}
3094
func Gopath() string {
	epath := os.Getenv("GOPATH")
	if epath == "" {
		// It's now safe to assume $HOME/go
		// thanks to Dave Cheney and the folks
		// who work on the standard library
		// https://github.com/golang/go/issues/17262
		path := fmt.Sprintf("%s/go", local.Home())
		return path
	} else if strings.Contains(epath, ":") {
		espl := strings.Split(epath, ":")
		if len(espl) <= 1 {
			return epath
		}
		// Here we will take the first gopath defined and use that
		return espl[0]
	}
	return epath
}
52967
func (m *Mount) GetParentPaths() ([]string, error) {
	var parentLayerPaths []string
	for _, option := range m.Options {
		if strings.HasPrefix(option, ParentLayerPathsFlag) {
			err := json.Unmarshal([]byte(option[len(ParentLayerPathsFlag):]), &parentLayerPaths)
			if err != nil {
				return nil, errors.Wrap(err, "failed to unmarshal parent layer paths from mount")
			}
		}
	}
	return parentLayerPaths, nil
}
566838
func GetGoVars() (string, string, error) {
	gopath := os.Getenv("GOPATH")
	if gopath == "" {
		return "", "", errors.New("Please set the $GOPATH environment variable")
	}

	goroot := filepath.Clean(runtime.GOROOT())
	if goroot == "" {
		return "", "", errors.New("Please set $GOROOT environment variable")
	}

	return gopath, goroot, nil
}
1268344
func (custom *GoCustomizations) getGoPath() (string, string) {
	fakeGoPath := filepath.Join(custom.paths.TmpDir, "gopath")
	if custom.Configuration.GoPath == "" {
		return fakeGoPath, fakeGoPath
	}
	return custom.Configuration.GoPath, fakeGoPath
}
1287839
func (m fieldMap) getTraversals(names []string) [][]int {
	var traversals [][]int
	for _, name := range names {
		f, ok := m[name]
		if !ok {
			panic(fmt.Errorf("db field '%s' has no mapping", name))
		}
		traversals = append(traversals, f.Index)
	}
	return traversals
}
307037
func GoPath() string {
	if gopath != "" {
		return gopath
	}

	path := os.Getenv("GOPATH")
	if len(path) == 0 {
		goCmd := exec.Command("go", "env", "GOPATH")
		out, err := goCmd.Output()
		if err != nil {
			panic(fmt.Sprintf("failed to determine gopath: %v", err))
		}
		path = string(out)
	}
	gopath = path
	return path
}
525280
func Paths(path string, recurse bool) (paths []string, err error) {
	err = filepath.Walk(path, func(f string, info os.FileInfo, err error) error {
		if !recurse {
			if path != f && path != filepath.Dir(f) {
				return filepath.SkipDir
			}
		}
		paths = append(paths, f)
		return nil
	})
	return paths, err
}
1186638
func (p *V2) GetLocations() ([]common.Location, error) {
	p.RLock()
	defer p.RUnlock()
	if len(p.locations) == 0 {
		return nil, common.ErrNotFound
	}
	locations := make([]common.Location, len(p.locations))
	i := 0
	for _, location := range p.locations {
		locations[i] = location
		i++
	}

	return locations, nil
}
991948
func (r *GoHeader) GetKeys() (value []string) {
	if !r.isResponse {
		for key := range r.Source.(*GoRequest).Original.Header {
			value = append(value, key)
		}
	} else {
		for key := range r.Source.(*GoResponse).Original.Header() {
			value = append(value, key)
		}
	}
	return
}
432684
func (p *PullRequestComment) GetPath() string {
	if p == nil || p.Path == nil {
		return ""
	}
	return *p.Path
}