From f63aef7fe4f75d4f7e4e0e7111000d07f570f422 Mon Sep 17 00:00:00 2001 From: Viktor Stanchev Date: Mon, 23 May 2022 21:17:15 +0000 Subject: [PATCH] fix #2190 - don't use backslash for "embed" paths on windows --- codegen/data.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codegen/data.go b/codegen/data.go index 3a636e3bdb..e7e1ac070c 100644 --- a/codegen/data.go +++ b/codegen/data.go @@ -3,7 +3,7 @@ package codegen import ( "fmt" "os" - "path/filepath" + "path" "sort" "strings" @@ -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) }