func detectProfileInFallbackSearchDirs(file string) (string, bool) {
	for _, dir := range profileFallbackSearchDirs {
		filePath := JoinPath(dir, file)
		if IsDir(dir) && IsFile(filePath) {
			return filePath, true
		}
	}
	return "", false
}
detectProfileInFallbackSearchDirs accepts a string with the name of a
profile file, and search the file in profileFallbackSearchDirs. It returns
(a string with the path of the profile file, true) if the profile file has
been found, and ("", false) otherwise.
package freedom
import (
	"fmt"
	"os"
	"path"
	"github.com/BurntSushi/toml"
)
var (
	profileFallbackSearchDirs = []string{"./conf", "./server/conf"}
	configurator Configurator
	EnvProfileDir = "FREEDOM_PROJECT_CONFIG"
	ProfileENV = EnvProfileDir
	cachedProfileDir string
)
var _ Configurator = (*fallbackConfigurator)(nil)
type Configurer = Configurator
type Configurator interface {
	Configure(obj interface{}, file string, metaData ...interface{}) error
}
func initConfigurator() {
	SetConfigurator(newFallbackConfigurator())
}
func SetConfigurator(c Configurator) {
	configurator = c
}
func SetConfigurer(c Configurer) {
	SetConfigurator(c)
}
func Configure(obj interface{}, file string, metaData ...interface{}) error {
	return configurator.Configure(obj, file)
}