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

Example for squashfs creation is not really valid #273

Open
seanenck opened this issue Dec 26, 2024 · 1 comment
Open

Example for squashfs creation is not really valid #273

seanenck opened this issue Dec 26, 2024 · 1 comment

Comments

@seanenck
Copy link

The examples/squashfs_create.go will not ever really be viable when doing proper error checking of returned values as it calls CreateFilesystem which will always return a filesystem.ErrReadonlyFilesystem for filesystem.TypeSquashfs.

If it is possible to properly create a writable squashfs the example should be updated to properly show how it is suggested to handle above error (I know how to check types of errors in go, I'm suggesting that the example should either note the error to check if it can be ignored in this case for creating a squashfs object)

@deitch
Copy link
Collaborator

deitch commented Dec 26, 2024

Yeah, that is a valid point. We should have:

  1. A new examples/squashfs_read.go that reads it via the way shown, and then use it to read something
  2. The existing examples/squashfs_create.go that does it the way the tests do and successfully creates.

Want to open a PR to fix it?

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

No branches or pull requests

2 participants