Skip to content

Commit

Permalink
use forward slashes during embed discovery (bazel-contrib#1101)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgolsson authored Oct 22, 2021
1 parent 091034a commit 67a3e22
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions language/go/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,12 @@ func (er *embedResolver) resolve(embed fileEmbed) (list []string, err error) {
// would not include "a/.e".
var visit func(*embeddableNode, bool)
visit = func(f *embeddableNode, add bool) {
match, _ := path.Match(embed.path, f.path)
convertedPath := filepath.ToSlash(f.path)
match, _ := path.Match(embed.path, convertedPath)
add = match || (add && !f.isHidden())
if !f.isDir() {
if add {
list = append(list, f.path)
list = append(list, convertedPath)
}
return
}
Expand Down

0 comments on commit 67a3e22

Please sign in to comment.