Skip to content

Adds AsMap to iterate over .Files.Glob#159

Merged
norwoodj merged 1 commit intonorwoodj:masterfrom
terricain:files_asmap
Nov 2, 2023
Merged

Adds AsMap to iterate over .Files.Glob#159
norwoodj merged 1 commit intonorwoodj:masterfrom
terricain:files_asmap

Conversation

@terricain
Copy link
Copy Markdown
Contributor

So you can't use range over the response from .Files.Glob as it doesnt return a map/slice, so I've added a convenience function to return the underlying files map.

So

{{ range $path, $_ :=  (.Files.Glob  "**.yaml") -}}

becomes
{{ range $path, $_ := (.Files.Glob "**.yaml").AsMap -}}

@Nepo26 Nepo26 mentioned this pull request Jul 3, 2023
12 tasks
@Nepo26 Nepo26 added this to the General Cleanup milestone Jul 25, 2023
@norwoodj norwoodj merged commit 3b87f0a into norwoodj:master Nov 2, 2023
@terricain terricain deleted the files_asmap branch November 2, 2023 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants