Skip to content

Commit

Permalink
fix #2190 - don't use backslash for "embed" paths on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
vikstrous committed May 23, 2022
1 parent 0cce554 commit f63aef7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions codegen/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package codegen
import (
"fmt"
"os"
"path/filepath"
"path"
"sort"
"strings"

Expand Down Expand Up @@ -177,8 +177,8 @@ func BuildData(cfg *config.Config) (*Data, error) {
return nil, fmt.Errorf("failed to get working directory: %w", err)
}
outputDir := cfg.Exec.Dir()
sourcePath := filepath.Join(wd, s.Name)
relative, err := filepath.Rel(outputDir, sourcePath)
sourcePath := path.Join(wd, s.Name)
relative, err := path.ToSlash(filefile.Rel(outputDir, sourcePath))
if err != nil {
return nil, fmt.Errorf("failed to compute path of %s relative to %s: %w"+sourcePath, outputDir, err)
}
Expand Down

0 comments on commit f63aef7

Please sign in to comment.