MCPcopy Create free account
hub / github.com/docker/compose / rawEnv

Function rawEnv

cmd/compose/compose.go:76–86  ·  view source on GitHub ↗

rawEnv load a dot env file using docker/cli key=value parser, without attempt to interpolate or evaluate values

(r io.Reader, filename string, vars map[string]string, lookup func(key string) (string, bool))

Source from the content-addressed store, hash-verified

74
75// rawEnv load a dot env file using docker/cli key=value parser, without attempt to interpolate or evaluate values
76func rawEnv(r io.Reader, filename string, vars map[string]string, lookup func(key string) (string, bool)) error {
77 lines, err := kvfile.ParseFromReader(r, lookup)
78 if err != nil {
79 return fmt.Errorf("failed to parse env_file %s: %w", filename, err)
80 }
81 for _, line := range lines {
82 key, value, _ := strings.Cut(line, "=")
83 vars[key] = value
84 }
85 return nil
86}
87
88var stdioToStdout bool
89

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected