Skip to content

Commit

Permalink
lint: fix a few issues reported by revive
Browse files Browse the repository at this point in the history
  • Loading branch information
panjf2000 committed Jan 4, 2025
1 parent 4ebe3fa commit 7bfa4c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions eventloop_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,11 @@ func (el *eventloop) close(c *conn, err error) error {
if len(iov) > iovMax {
iov = iov[:iovMax]
}
if n, e := gio.Writev(c.fd, iov); e != nil {
n, err := gio.Writev(c.fd, iov)
if err != nil {

Check warning on line 242 in eventloop_unix.go

View check run for this annotation

Codecov / codecov/patch

eventloop_unix.go#L241-L242

Added lines #L241 - L242 were not covered by tests
break
} else { //nolint:revive
_, _ = c.outboundBuffer.Discard(n)
}
_, _ = c.outboundBuffer.Discard(n)

Check warning on line 245 in eventloop_unix.go

View check run for this annotation

Codecov / codecov/patch

eventloop_unix.go#L245

Added line #L245 was not covered by tests
}

c.release()
Expand Down
4 changes: 2 additions & 2 deletions pkg/queue/lock_free_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,6 @@ func load(p *unsafe.Pointer) (n *node) {
return (*node)(atomic.LoadPointer(p))
}

func cas(p *unsafe.Pointer, old, new *node) bool {
return atomic.CompareAndSwapPointer(p, unsafe.Pointer(old), unsafe.Pointer(new))
func cas(p *unsafe.Pointer, oldNode, newNode *node) bool {
return atomic.CompareAndSwapPointer(p, unsafe.Pointer(oldNode), unsafe.Pointer(newNode))
}

0 comments on commit 7bfa4c5

Please sign in to comment.