Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Use fs.FS interface instead of os file access #63

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

MisterMX
Copy link
Contributor

@MisterMX MisterMX commented Jan 22, 2024

Description of your changes

Replace all IO operations based on the os package with the ones from the abstract fs package and pass a fsys parameter down to functions that need it.

Use embed.FS in tests.

Depends on #62

I have:

@MisterMX MisterMX changed the title refactor: Use fs.FS interface instead of os file access refactor: Use fs.FS interface instead of os file access Jan 22, 2024
Replace all IO operations based on the `os` package with the ones from
the abstract `fs` package and pass a `fsys` parameter down to functions
that need it.

Use a custom `osFS` in main() that just wrap around `os.Open`.
Use `embed.FS` in tests.

Signed-off-by: Maximilian Blatt <maximilian.blatt-extern@deutschebahn.com>
@MisterMX MisterMX force-pushed the refactor/fs-interface branch 2 times, most recently from 5482acb to 1e44f6c Compare January 24, 2024 08:37
@MisterMX
Copy link
Contributor Author

Updated this PR and removed the dependency on #62.

main.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@phisco phisco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @MisterMX

@MisterMX MisterMX force-pushed the refactor/fs-interface branch 3 times, most recently from 21e7fb2 to 966acd6 Compare January 24, 2024 09:12
Copy link
Collaborator

@ezgidemirel ezgidemirel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MisterMX, LGTM!

@phisco phisco merged commit b1998a7 into crossplane-contrib:main Jan 24, 2024
6 checks passed
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.

None yet

3 participants