Skip to content

Commit

Permalink
Use context.CancelFunc instead of func() (#257)
Browse files Browse the repository at this point in the history
Where context cancellation function is referenced in struct types use
existing `context.CancelFunc` to represent.

Fixes #223
  • Loading branch information
masih authored Oct 26, 2021
1 parent 6c0156c commit b1d455e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ipldutil/traverser.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ type traverser struct {
blocksCount int
parentCtx context.Context
ctx context.Context
cancel func()
cancel context.CancelFunc
root ipld.Link
selector ipld.Node
visitor traversal.AdvVisitFn
Expand Down
2 changes: 1 addition & 1 deletion requestmanager/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ type AsyncLoader interface {
// to them.
type RequestManager struct {
ctx context.Context
cancel func()
cancel context.CancelFunc
messages chan requestManagerMessage
peerHandler PeerHandler
rc *responseCollector
Expand Down
2 changes: 1 addition & 1 deletion responsemanager/responsemanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ func (frb *fakeResponseBuilder) AddNotifee(notifee notifications.Notifee) {
type testData struct {
ctx context.Context
t *testing.T
cancel func()
cancel context.CancelFunc
blockStore map[ipld.Link][]byte
persistence ipld.LinkSystem
blockChainLength int
Expand Down

0 comments on commit b1d455e

Please sign in to comment.