Skip to content

Commit

Permalink
Merge pull request #73 from nspcc-dev/use-any-kw
Browse files Browse the repository at this point in the history
*: replace `interface{}` with `any` keyword
  • Loading branch information
roman-khimov authored Apr 4, 2023
2 parents 6518841 + 18fe358 commit 0108387
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions payload/consensus_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ type (
SetType(t MessageType)

// Payload returns this message's actual payload.
Payload() interface{}
Payload() any
// SetPayload sets this message's payload to p.
SetPayload(p interface{})
SetPayload(p any)

// GetChangeView returns payload as if it was ChangeView.
GetChangeView() ChangeView
Expand All @@ -45,7 +45,7 @@ type (
cmType MessageType
viewNumber byte

payload interface{}
payload any
}
)

Expand Down Expand Up @@ -144,11 +144,11 @@ func (m *message) SetType(t MessageType) {
}

// Payload implements ConsensusMessage interface.
func (m message) Payload() interface{} {
func (m message) Payload() any {
return m.payload
}

// SetPayload implements ConsensusMessage interface.
func (m *message) SetPayload(p interface{}) {
func (m *message) SetPayload(p any) {
m.payload = p
}
2 changes: 1 addition & 1 deletion payload/recovery_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (m *recoveryMessage) AddPayload(p ConsensusPayload) {
}
}

func fromPayload(t MessageType, recovery ConsensusPayload, p interface{}) *Payload {
func fromPayload(t MessageType, recovery ConsensusPayload, p any) *Payload {
return &Payload{
message: message{
cmType: t,
Expand Down

0 comments on commit 0108387

Please sign in to comment.