Skip to content

refactor: Extract shared config helpers#57

Merged
mojatter merged 1 commit intomainfrom
refactor/shared-config-helpers
Apr 13, 2026
Merged

refactor: Extract shared config helpers#57
mojatter merged 1 commit intomainfrom
refactor/shared-config-helpers

Conversation

@mojatter
Copy link
Copy Markdown
Owner

Summary

  • Move ErrRequiredConfigRoot to the s2 package as the single source of truth
  • Add s2.ParseRoot to replace duplicated root-parsing logic in s3, gcs, and azblob
  • Add cfg.Root validation to fs.NewStorage for osfs (previously allowed empty root, which silently used the current directory)
  • Backend packages retain deprecated aliases for backwards compatibility

Test plan

  • All existing tests pass
  • New TestParseRoot in config_test.go
  • New TestNewStorageOSFSEmptyRoot in fs/storage_test.go
  • golangci-lint run ./... reports 0 issues

…Root)

Move duplicated root-parsing logic and the required-root error
into the s2 package so that s3, gcs, and azblob backends share
a single implementation.
@mojatter mojatter force-pushed the refactor/shared-config-helpers branch from 3b2e578 to 6b12abe Compare April 13, 2026 06:36
@mojatter mojatter merged commit d9f60bc into main Apr 13, 2026
2 checks passed
@mojatter mojatter deleted the refactor/shared-config-helpers branch April 13, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant