MCPcopy Create free account
hub / github.com/compose-spec/compose-go / WithEnv

Function WithEnv

cli/options.go:193–200  ·  view source on GitHub ↗

WithEnv defines a key=value set of variables used for compose file interpolation

(env []string)

Source from the content-addressed store, hash-verified

191
192// WithEnv defines a key=value set of variables used for compose file interpolation
193func WithEnv(env []string) ProjectOptionsFn {
194 return func(o *ProjectOptions) error {
195 for k, v := range utils.GetAsEqualsMap(env) {
196 o.Environment[k] = v
197 }
198 return nil
199 }
200}
201
202// WithDiscardEnvFile sets discards the `env_file` section after resolving to
203// the `environment` section

Callers 2

TestProjectNameFunction · 0.85

Calls 1

GetAsEqualsMapFunction · 0.92

Tested by 2

TestProjectNameFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…