diff options
| author | ewy <ewy0@protonmail.com> | 2026-04-22 21:51:29 +0200 |
|---|---|---|
| committer | ewy <ewy0@protonmail.com> | 2026-04-22 21:51:29 +0200 |
| commit | d88661935fa2b6e2c0fe93345800113e1a71b451 (patch) | |
| tree | 0002f1152a4eebafee6e3dea4065964a50d786c0 /env | |
| parent | deebd135ffcb1c167f12ecf2d4c0aebdc14cbc86 (diff) | |
docs
Diffstat (limited to 'env')
| -rw-r--r-- | env/env.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 |
