rados: Do not use standard names as function arguments

'len' is already a standard library function. revive v1.4.0[1] started
looking into function related variables for such standard names as part
of redefines-builtin-id rule. Therefore use a different variable name
instead of 'len'.

[1] https://github.com/mgechev/revive/releases/tag/v1.4.0

Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
This commit is contained in:
Anoop C S 2024-09-24 17:54:36 +05:30 committed by mergify[bot]
parent d442b121db
commit b52c04c231
2 changed files with 5 additions and 5 deletions

View File

@ -85,8 +85,8 @@ func (ioctx *IOContext) GetSnapName(snapID SnapID) (string, error) {
err error
)
// range from 1k to 64KiB
retry.WithSizes(1024, 1<<16, func(len int) retry.Hint {
cLen := C.int(len)
retry.WithSizes(1024, 1<<16, func(length int) retry.Hint {
cLen := C.int(length)
buf = make([]byte, cLen)
ret := C.rados_ioctx_snap_get_name(
ioctx.ioctx,

View File

@ -298,11 +298,11 @@ func (c *Conn) WatcherFlush() error {
//
// NOTE: starting with pacific this is implemented as a C function and this can
// be replaced later
func decodeNotifyResponse(response *C.char, len C.size_t) ([]NotifyAck, []NotifyTimeout) {
if len == 0 || response == nil {
func decodeNotifyResponse(response *C.char, length C.size_t) ([]NotifyAck, []NotifyTimeout) {
if length == 0 || response == nil {
return nil, nil
}
b := (*[math.MaxInt32]byte)(unsafe.Pointer(response))[:len:len]
b := (*[math.MaxInt32]byte)(unsafe.Pointer(response))[:length:length]
pos := 0
num := binary.LittleEndian.Uint32(b[pos:])