diff --git a/README.md b/README.md index d6dd90cd..aae47b36 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/internal/mpsc/mpsc_test.go b/internal/mpsc/mpsc_test.go index f2a150ff..4c1dadc3 100644 --- a/internal/mpsc/mpsc_test.go +++ b/internal/mpsc/mpsc_test.go @@ -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) { @@ -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) } diff --git a/message.go b/message.go index 87bcc970..38fa619f 100644 --- a/message.go +++ b/message.go @@ -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 { diff --git a/pointer_test.go b/pointer_test.go index d770c666..5234195f 100644 --- a/pointer_test.go +++ b/pointer_test.go @@ -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) diff --git a/rpc/export.go b/rpc/export.go index 3d6b661b..d3867f37 100644 --- a/rpc/export.go +++ b/rpc/export.go @@ -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 diff --git a/rpc/rpc.go b/rpc/rpc.go index 634409c0..118b1e60 100644 --- a/rpc/rpc.go +++ b/rpc/rpc.go @@ -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 { @@ -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) { @@ -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 @@ -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 }