Refactor FileStore to JSONStore (#30)
Badges / coveralls (push) Successful in 31s

Reviewed-on: #30
Co-authored-by: Natercio Moniz <[email protected]>
This commit was merged in pull request #30.
This commit is contained in:
2026-09-06 18:42:58 +01:00
committed by natercio
parent e5961c0dff
commit 3c404699e5
6 changed files with 132 additions and 76 deletions
+2 -2
View File
@@ -113,7 +113,7 @@ func runWithIO(ctx context.Context, stdin io.Reader, stdout io.Writer) error {
// buildStore returns the Store implementation that BuildReport should use.
// When --state-file is empty an EphemeralStore is used so behaviour is
// identical to pre-persistence runs. Otherwise a JSON-backed FileStore is
// identical to pre-persistence runs. Otherwise a JSON-backed JSONStore is
// returned, wired to a platform-specific RecordSerializer.
func buildStore(stateFile, platform string, figi *ofigi.Client) (internal.Store, error) {
if stateFile == "" {
@@ -128,7 +128,7 @@ func buildStore(stateFile, platform string, figi *ofigi.Client) (internal.Store,
return nil, fmt.Errorf("unsupported platform for state persistence: %s", platform)
}
store, err := internal.NewFileStore(stateFile, platform, serializer)
store, err := internal.NewJSONStore(stateFile, platform, serializer)
if err != nil {
return nil, fmt.Errorf("creating file store: %w", err)
}