From 6a62890445ab892efe38989f33f116a948b3cb1d Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Tue, 9 Apr 2024 21:43:27 +1200 Subject: [PATCH] Fix Windows embed.FS path --- internal/storage/schemas.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/storage/schemas.go b/internal/storage/schemas.go index a7c6149..874e45c 100644 --- a/internal/storage/schemas.go +++ b/internal/storage/schemas.go @@ -7,7 +7,7 @@ import ( "embed" "encoding/json" "log" - "path/filepath" + "path" "sort" "strings" "text/template" @@ -103,8 +103,8 @@ func dbApplySchemas() error { continue } - s := schema{s.Name(), semver.MajorMinor(schemaID) + "." + semver.Patch(schemaID)} - scripts = append(scripts, s) + script := schema{s.Name(), semver.MajorMinor(schemaID) + "." + semver.Patch(schemaID)} + scripts = append(scripts, script) } // sort schemas by semver, low to high @@ -123,8 +123,8 @@ func dbApplySchemas() error { // already completed, ignore continue } - - b, err := schemaScripts.ReadFile(filepath.Join("schemas", s.Name)) + // use path.Join for Windows compatibility, see https://github.com/golang/go/issues/44305 + b, err := schemaScripts.ReadFile(path.Join("schemas", s.Name)) if err != nil { return err }