Skip to content

Commit

Permalink
chore: use forward slashes in file paths for go:embed (#2807)
Browse files Browse the repository at this point in the history
Fixes #2803.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
  • Loading branch information
huanjani authored Sep 3, 2021
1 parent 52ab188 commit a0d2a77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/pkg/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func newTextTemplate(name string) *template.Template {
}

func (t *Template) read(path string) (string, error) {
dat, err := t.fs.ReadFile(filepath.Join("templates", path))
dat, err := t.fs.ReadFile(filepath.ToSlash(filepath.Join("templates", path))) // We need to use "/" even on Windows with go:embed.
if err != nil {
return "", fmt.Errorf("read template %s: %w", path, err)
}
Expand Down

0 comments on commit a0d2a77

Please sign in to comment.