rbd: fix naming convention violations in snapshot.go

Fix up variable names that don't meet Go standards.

Command: gofmt -w -r 'c_snapname -> cSnapName' rbd/snapshot.go

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2021-07-19 15:03:47 -04:00 committed by John Mulligan
parent 848b877686
commit 7536a52346
1 changed files with 18 additions and 18 deletions

View File

@ -27,10 +27,10 @@ func (image *Image) CreateSnapshot(snapname string) (*Snapshot, error) {
return nil, err
}
c_snapname := C.CString(snapname)
defer C.free(unsafe.Pointer(c_snapname))
cSnapName := C.CString(snapname)
defer C.free(unsafe.Pointer(cSnapName))
ret := C.rbd_snap_create(image.image, c_snapname)
ret := C.rbd_snap_create(image.image, cSnapName)
if ret < 0 {
return nil, rbdError(ret)
}
@ -72,10 +72,10 @@ func (snapshot *Snapshot) Remove() error {
return err
}
c_snapname := C.CString(snapshot.name)
defer C.free(unsafe.Pointer(c_snapname))
cSnapName := C.CString(snapshot.name)
defer C.free(unsafe.Pointer(cSnapName))
return getError(C.rbd_snap_remove(snapshot.image.image, c_snapname))
return getError(C.rbd_snap_remove(snapshot.image.image, cSnapName))
}
// Rollback the image to the snapshot.
@ -87,10 +87,10 @@ func (snapshot *Snapshot) Rollback() error {
return err
}
c_snapname := C.CString(snapshot.name)
defer C.free(unsafe.Pointer(c_snapname))
cSnapName := C.CString(snapshot.name)
defer C.free(unsafe.Pointer(cSnapName))
return getError(C.rbd_snap_rollback(snapshot.image.image, c_snapname))
return getError(C.rbd_snap_rollback(snapshot.image.image, cSnapName))
}
// Protect a snapshot from unwanted deletion.
@ -102,10 +102,10 @@ func (snapshot *Snapshot) Protect() error {
return err
}
c_snapname := C.CString(snapshot.name)
defer C.free(unsafe.Pointer(c_snapname))
cSnapName := C.CString(snapshot.name)
defer C.free(unsafe.Pointer(cSnapName))
return getError(C.rbd_snap_protect(snapshot.image.image, c_snapname))
return getError(C.rbd_snap_protect(snapshot.image.image, cSnapName))
}
// Unprotect stops protecting the snapshot.
@ -117,10 +117,10 @@ func (snapshot *Snapshot) Unprotect() error {
return err
}
c_snapname := C.CString(snapshot.name)
defer C.free(unsafe.Pointer(c_snapname))
cSnapName := C.CString(snapshot.name)
defer C.free(unsafe.Pointer(cSnapName))
return getError(C.rbd_snap_unprotect(snapshot.image.image, c_snapname))
return getError(C.rbd_snap_unprotect(snapshot.image.image, cSnapName))
}
// IsProtected returns true if the snapshot is currently protected.
@ -135,10 +135,10 @@ func (snapshot *Snapshot) IsProtected() (bool, error) {
var c_is_protected C.int
c_snapname := C.CString(snapshot.name)
defer C.free(unsafe.Pointer(c_snapname))
cSnapName := C.CString(snapshot.name)
defer C.free(unsafe.Pointer(cSnapName))
ret := C.rbd_snap_is_protected(snapshot.image.image, c_snapname,
ret := C.rbd_snap_is_protected(snapshot.image.image, cSnapName,
&c_is_protected)
if ret < 0 {
return false, rbdError(ret)