Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add go1.16 embed.FS loader #216

Merged
merged 2 commits into from
Mar 7, 2024
Merged

Conversation

ryanlath
Copy link
Contributor

@ryanlath ryanlath commented Mar 3, 2024

Adds embed.FS Loader. Requires go version 1.16
Addresses: #191

Comment on lines 32 to 33
_, err := l.fs.Open(filepath.Join(l.dir, filepath.FromSlash(name)))
return err == nil && !os.IsNotExist(err)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since embed.FS.Open() might return a directory "file", we should also check for that using fs.File.Stat() and IsDir. See

jet/loader.go

Line 74 in 1926e5e

stat, err := os.Stat(templatePath)
where something similar is done.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@sauerbraten sauerbraten merged commit eb1f1c6 into CloudyKit:master Mar 7, 2024
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.

2 participants