bump compose-go to version v2.6.0

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
This commit is contained in:
Guillaume Lours
2025-04-10 18:02:16 +02:00
parent f8de3c3bdc
commit 0b4e624aaa
23 changed files with 397 additions and 768 deletions

View File

@@ -41,16 +41,23 @@ func Parse(r io.Reader) (map[string]string, error) {
// ParseWithLookup reads an env file from io.Reader, returning a map of keys and values.
func ParseWithLookup(r io.Reader, lookupFn LookupFn) (map[string]string, error) {
vars := map[string]string{}
err := parseWithLookup(r, vars, lookupFn)
return vars, err
}
// ParseWithLookup reads an env file from io.Reader, returning a map of keys and values.
func parseWithLookup(r io.Reader, vars map[string]string, lookupFn LookupFn) error {
data, err := io.ReadAll(r)
if err != nil {
return nil, err
return err
}
// seek past the UTF-8 BOM if it exists (particularly on Windows, some
// editors tend to add it, and it'll cause parsing to fail)
data = bytes.TrimPrefix(data, utf8BOM)
return UnmarshalBytesWithLookup(data, lookupFn)
return newParser().parse(string(data), vars, lookupFn)
}
// Load will read your env file(s) and load them into ENV for this process.