From a59c6b9f8436f5558955cd6c305a4144b0937cad Mon Sep 17 00:00:00 2001 From: Stefan Benz <46600784+stebenz@users.noreply.github.com> Date: Wed, 29 Jan 2025 09:53:27 +0100 Subject: [PATCH] fix: change usage from filepath to path (#9260) # Which Problems Are Solved Paths for setup steps are joined with "\" when binary is started under Windows, which results in wrongly joined paths. # How the Problems Are Solved Replace the usage of "filepath" with "path" package, which does only join with "/" and nothing OS specific. # Additional Changes None # Additional Context Closes #9227 --- cmd/setup/setup.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/setup/setup.go b/cmd/setup/setup.go index 0b13a66ce0..2394af2024 100644 --- a/cmd/setup/setup.go +++ b/cmd/setup/setup.go @@ -5,7 +5,7 @@ import ( "embed" _ "embed" "net/http" - "path/filepath" + "path" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -279,7 +279,7 @@ func mustExecuteMigration(ctx context.Context, eventstoreClient *eventstore.Even // Typ describes the database dialect and may be omitted if no // dialect specific migration is specified. func readStmt(fs embed.FS, folder, typ, filename string) (string, error) { - stmt, err := fs.ReadFile(filepath.Join(folder, typ, filename)) + stmt, err := fs.ReadFile(path.Join(folder, typ, filename)) return string(stmt), err } @@ -293,7 +293,7 @@ type statement struct { // Typ describes the database dialect and may be omitted if no // dialect specific migration is specified. func readStatements(fs embed.FS, folder, typ string) ([]statement, error) { - basePath := filepath.Join(folder, typ) + basePath := path.Join(folder, typ) dir, err := fs.ReadDir(basePath) if err != nil { return nil, err