api: address revive unexported-return issues

Signed-off-by: Ivan Valdes <ivan@vald.es>
This commit is contained in:
Ivan Valdes 2024-09-26 14:31:27 -07:00
parent c1976a6717
commit 3654d03c1e
No known key found for this signature in database
GPG Key ID: 4037D37741ED0CC5

View File

@ -72,13 +72,13 @@ func (as *InternalRaftStringer) String() string {
return as.Request.String() return as.Request.String()
} }
// txnRequestStringer implements a custom proto String to replace value bytes fields with value size // txnRequestStringer implements fmt.Stringer, a custom proto String to replace value bytes
// fields in any nested txn and put operations. // fields with value size fields in any nested txn and put operations.
type txnRequestStringer struct { type txnRequestStringer struct {
Request *TxnRequest Request *TxnRequest
} }
func NewLoggableTxnRequest(request *TxnRequest) *txnRequestStringer { func NewLoggableTxnRequest(request *TxnRequest) fmt.Stringer {
return &txnRequestStringer{request} return &txnRequestStringer{request}
} }
@ -155,8 +155,8 @@ func (m *loggableValueCompare) Reset() { *m = loggableValueCompare{} }
func (m *loggableValueCompare) String() string { return proto.CompactTextString(m) } func (m *loggableValueCompare) String() string { return proto.CompactTextString(m) }
func (*loggableValueCompare) ProtoMessage() {} func (*loggableValueCompare) ProtoMessage() {}
// loggablePutRequest implements a custom proto String to replace value bytes field with a value // loggablePutRequest implements proto.Message, a custom proto String to replace value bytes
// size field. // field with a value size field.
// To preserve proto encoding of the key bytes, a faked out proto type is used here. // To preserve proto encoding of the key bytes, a faked out proto type is used here.
type loggablePutRequest struct { type loggablePutRequest struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3"` Key []byte `protobuf:"bytes,1,opt,name=key,proto3"`
@ -167,7 +167,7 @@ type loggablePutRequest struct {
IgnoreLease bool `protobuf:"varint,6,opt,name=ignore_lease,proto3"` IgnoreLease bool `protobuf:"varint,6,opt,name=ignore_lease,proto3"`
} }
func NewLoggablePutRequest(request *PutRequest) *loggablePutRequest { func NewLoggablePutRequest(request *PutRequest) proto.Message {
return &loggablePutRequest{ return &loggablePutRequest{
request.Key, request.Key,
int64(len(request.Value)), int64(len(request.Value)),