loader logic revised

This commit is contained in:
IliaDenisov
2026-03-16 15:48:00 +02:00
parent cc7ecf6667
commit e6c6970947
13 changed files with 530 additions and 82 deletions
+1 -1
View File
@@ -179,7 +179,7 @@ func (s *fsStorage) FileExists(path string) (bool, string, error) {
return false, "", err
}
if !exists {
return false, "", nil
return false, absPath, nil
}
return true, absPath, nil
}
+4 -3
View File
@@ -191,8 +191,9 @@ func TestRawFileCRUDAndList(t *testing.T) {
if missingExists {
t.Fatal("missing.txt should not exist")
}
if missingPath != "" {
t.Fatalf("missing file path = %q, want empty string", missingPath)
wantMissingPath := filepath.Join(s.storageRoot, "missing.txt")
if wantMissingPath != missingPath {
t.Fatalf("missing file path = %q, want %q", missingPath, wantMissingPath)
}
alphaData, err := s.ReadFile("nested/alpha.txt")
@@ -478,7 +479,7 @@ func sampleState() client.State {
{ID: client.GameID("game-1"), LastTurn: 12, ActiveTurn: 11},
{ID: client.GameID("game-2"), LastTurn: 4, ActiveTurn: 4},
},
ActiveGameID: client.GameID("game-2"),
ActiveGameID: new(client.GameID("game-2")),
}
}