Created
October 31, 2024 05:35
-
-
Save bardic/7de4f19ac099627d0b8b0e5bb04c5d5a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "embed" | |
| "fmt" | |
| "io/fs" | |
| ) | |
| //tmpl contains 3 empty files for example; 1,2,3 | |
| //go:embed tmpl/* | |
| var templates embed.FS | |
| func main() { | |
| fs.WalkDir(templates, ".", func(path string, d fs.DirEntry, err error) error { | |
| fmt.Println(path) | |
| return nil | |
| }) | |
| } | |
| //Output: | |
| //. | |
| //tmpl | |
| //tmpl/1 | |
| //tmpl/2 | |
| //tmpl/3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment