You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Removing the default Overload() would be very welcome. For traditional UNIX folks who expect var=value someprogram to override any file-based configuration (particularly in absence of godotenv.Overload() calls within someprogram's source), this is a serious violation of principle-of-least-surprise.
Progress
Direction
os.Getenv()
families with virtual features like envy only env or sandbox.env
auto-loading or change it to manualContext
Envy is currently used by cli, buffalo, pop, meta v0, and clara. Also, the generated app uses it for mostly
.env
support which is a nice thing.Currently, envy provides the following public functions:
Get(key string, value string) string
- returns a value from the ENV, otherwise returns the given defaultMustGet(key string) (string, error)
- returns a value from the ENV. no default but returns an errorSet(key string, value string)
- sets the value only into envy, not on the underlying ENVMustSet(key string, value string) error
- sets the value into the underlying ENV, as well as envy.Environ() []string
- returns an array of env representationLoad(files ...string) error
- load .env filesReload()
- reload the ENV variablesMap() map[string]string
- returns all of the keys/values set in envy (no module uses it)Temp(f func())
- a kind of sandbox --> still useful for testingGoBin() string
- returns "GO_BIN", just a wrapper ofGet("GO_BIN", "go")
GoPath() string
- returns "GOPATH", just a wrapper ofGet("GOPATH", "")
GoPaths() []string
- returns all possible GOPATH that are set --> could be deprecatedInGoPath() bool
- check if the current working directory is within GOPATH --> could be deprecatedCurrentModule() (string, error)
- return the module name fromgo.mod
--> could be deprecatedAlso, it provides
.env
loading.I don't think golang-related functions are still useful. All could be deprecated.
@gobuffalo/core-managers what do you think?
The text was updated successfully, but these errors were encountered: