From d88661935fa2b6e2c0fe93345800113e1a71b451 Mon Sep 17 00:00:00 2001 From: ewy Date: Wed, 22 Apr 2026 21:51:29 +0200 Subject: docs --- env/env.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'env') diff --git a/env/env.go b/env/env.go index 2a76e33..f1bd9d8 100644 --- a/env/env.go +++ b/env/env.go @@ -12,6 +12,8 @@ import ( "slices" ) +// IsEnv returns whether a given file is suitable for environment loading +// this method respects the --env flag func IsEnv(file string) bool { options := []string{ ".env", @@ -26,6 +28,7 @@ func IsEnv(file string) bool { return slices.Contains(options, file) } +// Files returns a list of files (that exist) that should be indexed and used as environment files func Files(f fs.FS, p string, deep bool) []string { var result []string dir, err := fs.ReadDir(f, p) @@ -43,6 +46,7 @@ func Files(f fs.FS, p string, deep bool) []string { return result } +// Get returns all environment key-value pairs we should index for a source func Get(src *model.Source) []string { f := os.DirFS(src.Path) var result []string -- cgit v1.3.1