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

fix: readFile on windows (works cross-platform) #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joshuaslate
Copy link

Using path instead of filepath fixes an issue on Windows where the template files could not be found. I tested these changes on macOS and Windows and they worked for me.

Relevant docs:

https://pkg.go.dev/embed

...
The path separator is a forward slash, even on Windows systems.
...

https://pkg.go.dev/path/filepath

The filepath package uses either forward slashes or backslashes, depending on the operating system. To process paths such as URLs that always use forward slashes regardless of the operating system, see the [path](https://pkg.go.dev/path) package.

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.

1 participant