Skip to content

Commit

Permalink
Merge pull request #281 from capnproto/cleanup/lintfix
Browse files Browse the repository at this point in the history
Clean up formatting, inefassign and misspellings.
  • Loading branch information
zenhack authored Aug 1, 2022
2 parents 0dc9cc8 + 1fd6c01 commit ecf31e6
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Cap'n Proto bindings for Go

![License](https://img.shields.io/badge/license-MIT-brightgreen?style=flat-square)
![CodeQuality](https://goreportcard.com/badge/capnproto.org/go/capnp)
[![CodeQuality](https://goreportcard.com/badge/capnproto.org/go/capnp)](https://goreportcard.com/report/capnproto.org/go/capnp/v3)
[![Go](https://github.com/capnproto/go-capnproto2/actions/workflows/go.yml/badge.svg)](https://github.com/capnproto/go-capnproto2/actions/workflows/go.yml)
[![GoDoc](https://godoc.org/capnproto.org/go/capnp/v3?status.svg)][godoc]
[![Matrix](https://img.shields.io/matrix/go-capnp:matrix.org?color=lightpink&label=Get%20Help&logo=matrix&style=flat-square)](https://matrix.to/#/#go-capnp:matrix.org)
Expand Down
4 changes: 2 additions & 2 deletions internal/mpsc/mpsc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func TestSendManySequential(t *testing.T) {
assert.Equal(t, inputs, outputs, "Received sequence was different from sent.")

v, ok := q.TryRecv()
assert.False(t, ok, "Recieved more values than expected: ", v)
assert.False(t, ok, "Received more values than expected: ", v)
}

func TestSendManyConcurrent(t *testing.T) {
Expand Down Expand Up @@ -111,5 +111,5 @@ func TestSendManyConcurrent(t *testing.T) {
assert.Equal(t, expected, actual, "Different values came out of the queue than went in.")

v, ok := q.TryRecv()
assert.False(t, ok, "Recieved more values than expected: ", v)
assert.False(t, ok, "Received more values than expected: ", v)
}
2 changes: 1 addition & 1 deletion message.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func NewSingleSegmentMessage(b []byte) (msg *Message, first *Segment) {
return msg, first
}

// Analagous to NewSingleSegmentMessage, but using MutliSegment.
// Analogous to NewSingleSegmentMessage, but using MutliSegment.
func NewMultiSegmentMessage(b [][]byte) (msg *Message, first *Segment) {
msg, first, err := NewMessage(MultiSegment(b))
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pointer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ func TestEqual(t *testing.T) {
0: ec,
1: ec,
2: ErrorClient(errors.New("another boo")),
3: Client{},
4: Client{},
3: {},
4: {},
}
iface1 := NewInterface(seg, 0)
iface2 := NewInterface(seg, 1)
Expand Down
2 changes: 1 addition & 1 deletion rpc/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (c *Conn) fillPayloadCapTable(payload rpccp.Payload, clients []capnp.Client
for i, client := range clients {
id, isExport, err := c.sendCap(list.At(i), client)
if err != nil {
return nil, rpcerr.Failedf("Serializing capabiltiy: %w", err)
return nil, rpcerr.Failedf("Serializing capability: %w", err)
}
if !isExport {
continue
Expand Down
12 changes: 6 additions & 6 deletions rpc/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -1154,11 +1154,11 @@ func (c *Conn) recvCap(d rpccp.CapDescriptor) (capnp.Client, error) {
case rpccp.CapDescriptor_Which_receiverAnswer:
promisedAnswer, err := d.ReceiverAnswer()
if err != nil {
return capnp.Client{}, rpcerr.Failedf("receive capabiltiy: reading promised answer: %v", err)
return capnp.Client{}, rpcerr.Failedf("receive capability: reading promised answer: %v", err)
}
rawTransform, err := promisedAnswer.Transform()
if err != nil {
return capnp.Client{}, rpcerr.Failedf("receive capabiltiy: reading promised answer transform: %v", err)
return capnp.Client{}, rpcerr.Failedf("receive capability: reading promised answer transform: %v", err)
}
transform, err := parseTransform(rawTransform)
if err != nil {
Expand Down Expand Up @@ -1205,7 +1205,7 @@ func (c *Conn) recvCapReceiverAnswer(ans *answer, transform []capnp.PipelineOp)
return capnp.ErrorClient(rpcerr.Failedf("Result is not a capability"))
}

// We can't just call Client(), becasue the CapTable has been cleared; instead,
// We can't just call Client(), because the CapTable has been cleared; instead,
// look it up in resultCapTable ourselves:
capId := int(iface.Capability())
if capId < 0 || capId >= len(ans.resultCapTable) {
Expand All @@ -1216,7 +1216,7 @@ func (c *Conn) recvCapReceiverAnswer(ans *answer, transform []capnp.PipelineOp)
}

// Returns whether the client should be treated as local, for the purpose of
// embargos.
// embargoes.
func (c *Conn) isLocalClient(client capnp.Client) bool {
if (client == capnp.Client{}) {
return false
Expand Down Expand Up @@ -1364,8 +1364,8 @@ func (c *Conn) handleDisembargo(ctx context.Context, d rpccp.Disembargo, release
return
}

ptr, err := capnp.Transform(content, tgt.transform)
if err != nil {
var ptr capnp.Ptr
if ptr, err = capnp.Transform(content, tgt.transform); err != nil {
err = rpcerr.Failedf("incoming disembargo: read answer ID %d: %v", tgt.promisedAnswer, err)
return
}
Expand Down

0 comments on commit ecf31e6

Please sign in to comment.