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)