// defaultGoPath returns the system's default GOPATH. If the system
// has multiple GOPATHs then the first is used.
509585
func defaultGoPath() string {
	gpDefault := build.Default.GOPATH
	gps := filepath.SplitList(gpDefault)

	return gps[0]
}
502682
func (n *roFileVersion) fullPath() string {
	if n == nil {
		return ""
	}
	return filepath.Join(n.parent.fullPath(), n.name)
}
1295472
func PackagePath(pkgName string) string {
	gopath := os.Getenv("GOPATH")
	if gopath == "" {
		return ""
	}

	fn := func(c rune) bool {
		sep := os.PathListSeparator

		return c == sep && sep != path2.UNKNOWN
	}
	for _, path := range strings.FieldsFunc(gopath, fn) {
		path = filepath.Join(path, "src", pkgName)

		if file.IsExist(path) && file.IsDir(path) {
			return path
		}
	}

	return ""
}
1348547
func (conf *Config) GetInitPath() string {
	conf.Lock()
	defer conf.Unlock()
	if conf.InitPath != "" {
		return conf.InitPath
	}
	if conf.DefaultInitBinary != "" {
		return conf.DefaultInitBinary
	}
	return DefaultInitBinary
}
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
}
170273
func NewWithPath(path string) *DefaultLoader {
	loaders := []Loader{}

	// Read default values defined via tag fields "default"
	loaders = append(loaders, &TagLoader{})

	// Choose what while is passed
	if strings.HasSuffix(path, "toml") {
		loaders = append(loaders, &TOMLLoader{Path: path})
	}

	if strings.HasSuffix(path, "json") {
		loaders = append(loaders, &JSONLoader{Path: path})
	}

	if strings.HasSuffix(path, "yml") || strings.HasSuffix(path, "yaml") {
		loaders = append(loaders, &YAMLLoader{Path: path})
	}

	e := &EnvironmentLoader{}
	f := &FlagLoader{}

	loaders = append(loaders, e, f)
	loader := MultiLoader(loaders...)

	d := &DefaultLoader{}
	d.Loader = loader
	d.Validator = MultiValidator(&RequiredValidator{})
	return d
}
1256462
func defaultPath(action *design.ActionDefinition) string {
	for _, r := range action.Routes {
		candidate := r.FullPath()
		if !strings.ContainsRune(candidate, ':') {
			return candidate
		}
	}
	return ""
}
643434
func (s *Set) AddGopathPath(path string) {
	if loader, ok := s.loader.(hasAddGopathPath); ok {
		loader.AddGopathPath(path)
	} else {
		panic(fmt.Sprintf("AddGopathPath() not supported on custom loader of type %T", s.loader))
	}
}
1201503
func (c Config) GetWALPath(base string) string {
	if c.WALPath != "" {
		return c.WALPath
	}
	return filepath.Join(base, DefaultWALDirectoryName)
}
1091163
func getDefaultOCISettingsPath() (string, error) {
	u, err := user.Current()
	if err != nil {
		return "", err
	}

	if u.HomeDir == "" {
		return "", fmt.Errorf("Unable to determine the home directory for the current user.")
	}

	path := filepath.Join(u.HomeDir, ".oci", "config")
	if _, err := os.Stat(path); err != nil {
		return "", err
	}

	return path, nil
}
752533
func DefaultGateway(r net.IP) func(*Server) error {
	return func(s *Server) error {
		s.defaultGateway = r
		return nil
	}
}
1209088
func Path(s string) GoEvtxPath {
	return strings.Split(strings.Trim(s, PathSeparator), PathSeparator)
}
959633
func Default() Func {
	f, err := New(&defaultPolicy)
	if err != nil {
		panic(fmt.Errorf("failed to instantiate default triggering policy - %s", err))
	}
	return f
}
65053
func DefaultImportPathToName(path, srcDir string) (string, error) {
	if path == "C" {
		return "C", nil
	}
	pkg, err := build.Default.Import(path, srcDir, 0)
	return pkg.Name, err
}
724605
func ResolvePath(path string, base string) string {
	// Don't resolve empty paths
	if len(path) > 0 {
		// Don't resolve absolute paths
		if !filepath.IsAbs(path) {
			return filepath.Join(base, path)
		}
	}

	return path
}
1289641
func (m *Meta) initStatePaths() {
	if m.statePath == "" {
		m.statePath = DefaultStateFilename
	}
	if m.stateOutPath == "" {
		m.stateOutPath = m.statePath
	}
	if m.backupPath == "" {
		m.backupPath = m.stateOutPath + DefaultBackupExtension
	}
}
710301
func (s *Sprocket) PushBackDefaultPath(path string) (err error) {
	if path, err = filepath.Abs(path); err != nil {
		return
	}
	s.defaultExtInfo.Paths.PushBackUniq(path)
	return
}