[config] remove old code
This commit is contained in:
@@ -17,28 +17,6 @@ func GetWithDefault(appName string, key string, defaultValue string) string {
|
|||||||
return env.GetDefault(key, defaultValue)
|
return env.GetDefault(key, defaultValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetWithDefault returns the value set for a given key, returning defaultValue if none found
|
|
||||||
// func GetWithDefault(appName string, key string, defaultValue string) (value string) {
|
|
||||||
// value = defaultValue
|
|
||||||
|
|
||||||
// envFile := strings.Join([]string{common.MustGetEnv("DOKKU_ROOT"), appName, "ENV"}, "/")
|
|
||||||
// lines, err := common.FileToSlice(envFile)
|
|
||||||
// if err != nil {
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// prefix := fmt.Sprintf("export %v=", key)
|
|
||||||
// for _, line := range lines {
|
|
||||||
// if !strings.HasPrefix(line, prefix) {
|
|
||||||
// continue
|
|
||||||
// }
|
|
||||||
// value = strings.TrimPrefix(line, prefix)
|
|
||||||
// if strings.HasPrefix(value, "'") && strings.HasSuffix(value, "'") {
|
|
||||||
// value = strings.TrimPrefix(strings.TrimSuffix(value, "'"), "'")
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
|
|
||||||
//HasKey determines if the config given by appName has a value for the given key
|
//HasKey determines if the config given by appName has a value for the given key
|
||||||
func HasKey(appName string, key string) bool {
|
func HasKey(appName string, key string) bool {
|
||||||
env, err := loadConfig(appName)
|
env, err := loadConfig(appName)
|
||||||
|
|||||||
Reference in New Issue
Block a user