Skip to content

Commit

Permalink
Removing cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe Dutra Tine E Silva committed Mar 26, 2018
1 parent e81af00 commit e83209a
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions gonfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import (
"strconv"
)

var configurationData interface{} = nil

// GetConf aggregates all the JSON and enviornment variable values
// and puts them into the passed interface.
func GetConf(filename string, configuration interface{}) (err error) {
Expand All @@ -21,20 +19,12 @@ func GetConf(filename string, configuration interface{}) (err error) {
if typ := configValue.Type(); typ.Kind() != reflect.Ptr || typ.Elem().Kind() != reflect.Struct {
return fmt.Errorf("configuration should be a pointer to a struct type.")
}
if configurationData != nil {
//configuration = configurationData
dataValue := reflect.ValueOf(configurationData)
configValue.Elem().Set(dataValue.Elem())
return
}


err = getFromJson(filename, configuration)
if err == nil {
getFromEnvVariables(configuration)
}

configurationData = configuration

return
}

Expand Down

0 comments on commit e83209a

Please sign in to comment.