pkg/loopback: format code with gofumpt

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-08-24 17:56:50 +02:00
parent b4d6eca9b8
commit 976da91fb7
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -27,7 +27,7 @@ func stringToLoopName(src string) [unix.LO_NAME_SIZE]uint8 {
}
func getNextFreeLoopbackIndex() (int, error) {
f, err := os.OpenFile("/dev/loop-control", os.O_RDONLY, 0644)
f, err := os.OpenFile("/dev/loop-control", os.O_RDONLY, 0o644)
if err != nil {
return 0, err
}
@ -55,7 +55,7 @@ func openNextAvailableLoopback(index int, sparseFile *os.File) (loopFile *os.Fil
}
// OpenFile adds O_CLOEXEC
loopFile, err = os.OpenFile(target, os.O_RDWR, 0644)
loopFile, err = os.OpenFile(target, os.O_RDWR, 0o644)
if err != nil {
log.G(context.TODO()).Errorf("Error opening loopback device: %s", err)
return nil, ErrAttachLoopbackDevice
@ -99,7 +99,7 @@ func AttachLoopDevice(sparseName string) (loop *os.File, err error) {
}
// OpenFile adds O_CLOEXEC
sparseFile, err := os.OpenFile(sparseName, os.O_RDWR, 0644)
sparseFile, err := os.OpenFile(sparseName, os.O_RDWR, 0o644)
if err != nil {
log.G(context.TODO()).Errorf("Error opening sparse file %s: %s", sparseName, err)
return nil, ErrAttachLoopbackDevice