Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: address revive unexported-return issues #18645

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions api/etcdserverpb/raft_internal_stringer.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ func (as *InternalRaftStringer) String() string {
return as.Request.String()
}

// txnRequestStringer implements a custom proto String to replace value bytes fields with value size
// TxnRequestStringer implements a custom proto String to replace value bytes fields with value size
// fields in any nested txn and put operations.
type txnRequestStringer struct {
type TxnRequestStringer struct {
Request *TxnRequest
}

func NewLoggableTxnRequest(request *TxnRequest) *txnRequestStringer {
return &txnRequestStringer{request}
func NewLoggableTxnRequest(request *TxnRequest) *TxnRequestStringer {
return &TxnRequestStringer{request}
}

func (as *txnRequestStringer) String() string {
func (as *TxnRequestStringer) String() string {
var compare []string
for _, c := range as.Request.Compare {
switch cv := c.TargetUnion.(type) {
Expand Down Expand Up @@ -155,10 +155,10 @@ func (m *loggableValueCompare) Reset() { *m = loggableValueCompare{} }
func (m *loggableValueCompare) String() string { return proto.CompactTextString(m) }
func (*loggableValueCompare) ProtoMessage() {}

// loggablePutRequest implements a custom proto String to replace value bytes field with a value
// LoggablePutRequest implements a custom proto String to replace value bytes field with a value
// size field.
// 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"`
ValueSize int64 `protobuf:"varint,2,opt,name=value_size,proto3"`
Lease int64 `protobuf:"varint,3,opt,name=lease,proto3"`
Expand All @@ -167,8 +167,8 @@ type loggablePutRequest struct {
IgnoreLease bool `protobuf:"varint,6,opt,name=ignore_lease,proto3"`
}

func NewLoggablePutRequest(request *PutRequest) *loggablePutRequest {
return &loggablePutRequest{
func NewLoggablePutRequest(request *PutRequest) *LoggablePutRequest {
return &LoggablePutRequest{
request.Key,
int64(len(request.Value)),
request.Lease,
Expand All @@ -178,6 +178,6 @@ func NewLoggablePutRequest(request *PutRequest) *loggablePutRequest {
}
}

func (m *loggablePutRequest) Reset() { *m = loggablePutRequest{} }
func (m *loggablePutRequest) String() string { return proto.CompactTextString(m) }
func (*loggablePutRequest) ProtoMessage() {}
func (m *LoggablePutRequest) Reset() { *m = LoggablePutRequest{} }
func (m *LoggablePutRequest) String() string { return proto.CompactTextString(m) }
func (*LoggablePutRequest) ProtoMessage() {}
Loading