File: README.md

package info (click to toggle)
golang-gopkg-freddierice-go-losetup.v1 0.0~git20170407.fc9adea-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 80 kB
  • sloc: makefile: 2
file content (24 lines) | stat: -rw-r--r-- 388 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# go-losetup
A losetup implementation for go-lang

## how to get it
```
go get gopkg.in/freddierice/go-losetup.v1
```

## example usage
```go
// attach a raw file to a loop device
dev, err := losetup.Attach("rawfile.img", 0, false)
if err != nil {
	// error checking
}

fmt.Printf("attached rawfile.img to %v\n", dev.Path())

err := dev.Detach()
if err != nil {
	// error checking
}
```