rbd: naming conventions: fixes in GetSnapshotNames function

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

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2021-07-19 16:48:54 -04:00 committed by John Mulligan
parent d1b251fef5
commit 1cbbe2cea5
1 changed files with 7 additions and 7 deletions

View File

@ -897,26 +897,26 @@ func (image *Image) GetSnapshotNames() (snaps []SnapInfo, err error) {
return nil, err
}
var c_max_snaps C.int
var cMaxSnaps C.int
ret := C.rbd_snap_list(image.image, nil, &c_max_snaps)
ret := C.rbd_snap_list(image.image, nil, &cMaxSnaps)
c_snaps := make([]C.rbd_snap_info_t, c_max_snaps)
snaps = make([]SnapInfo, c_max_snaps)
cSnaps := make([]C.rbd_snap_info_t, cMaxSnaps)
snaps = make([]SnapInfo, cMaxSnaps)
ret = C.rbd_snap_list(image.image,
&c_snaps[0], &c_max_snaps)
&cSnaps[0], &cMaxSnaps)
if ret < 0 {
return nil, rbdError(ret)
}
for i, s := range c_snaps {
for i, s := range cSnaps {
snaps[i] = SnapInfo{Id: uint64(s.id),
Size: uint64(s.size),
Name: C.GoString(s.name)}
}
C.rbd_snap_list_end(&c_snaps[0])
C.rbd_snap_list_end(&cSnaps[0])
return snaps[:len(snaps)-1], nil
}