koding / multiconfig

Load configuration from multiple sources in Go
http://godoc.org/github.com/koding/multiconfig
MIT License
454 stars 64 forks source link

env usage help prints env vars in random order #44

Closed client9 closed 8 years ago

client9 commented 8 years ago

from env.go

iteration over a map is random. Need to copy into the []string, sort, then then use that for range.

// PrintEnvs prints the generated environment variables to the std out.
func (e *EnvironmentLoader) PrintEnvs(s interface{}) {
    strct := structs.New(s)
    strctMap := strct.Map()
    prefix := e.getPrefix(strct)

    for key, val := range strctMap {
        field := strct.Field(key)

        e.printField(prefix, field, key, val)
    }
}
client9 commented 8 years ago

ahh this was a side effect of https://github.com/koding/multiconfig/commit/15a9baf17e5dc67025d30dd65c98bb7e2edc3dd1

client9 commented 8 years ago

fixed.