Open existing image using backend abstraction This is a proposed way of usage after factoring out underlying file operations to the backend. diskfs.Open() is slowly deprecating now.
()
| 162 | // This is a proposed way of usage after factoring out underlying file operations to the backend. |
| 163 | // diskfs.Open() is slowly deprecating now. |
| 164 | func ExampleOpenBackend_open() { |
| 165 | readOnly := true |
| 166 | theBackend, err := file.OpenFromPath("/tmp/my.img", readOnly) |
| 167 | check(err) |
| 168 | defer os.Remove("/tmp/my.img") |
| 169 | |
| 170 | theDisk, err := diskfs.OpenBackend(theBackend) |
| 171 | check(err) |
| 172 | unused(theDisk) |
| 173 | } |
| 174 | |
| 175 | // Instantiate the backend manually for later use in diskfs.OpenBackend |
| 176 | func ExampleOpenBackend_backend() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…