From 6f0d43320a3ed4fb8c9acb60cd33d21ddbd412ee Mon Sep 17 00:00:00 2001 From: adam jones Date: Tue, 2 Sep 2025 14:51:23 +0100 Subject: [PATCH] fix: use path.Join instead of filepath.Join for embedded migrations (#338) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes Windows compatibility issue where filepath.Join uses backslashes but embed.FS always expects forward slashes for embedded paths. Fixes #337 Also see https://github.com/golang/go/issues/44305 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: adam jones --- internal/database/migrate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/database/migrate.go b/internal/database/migrate.go index fbd67df..6713155 100644 --- a/internal/database/migrate.go +++ b/internal/database/migrate.go @@ -6,7 +6,7 @@ import ( "errors" "fmt" "log" - "path/filepath" + "path" "sort" "strconv" "strings" @@ -96,7 +96,7 @@ func (m *Migrator) loadMigrations() ([]Migration, error) { } // Read the migration SQL - content, err := migrationFiles.ReadFile(filepath.Join("migrations", name)) + content, err := migrationFiles.ReadFile(path.Join("migrations", name)) if err != nil { return nil, fmt.Errorf("failed to read migration file %s: %w", name, err) }