From ddd2593517905ca6ed7f3c13898183e385c660a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=BF=97=E5=AE=87?= Date: Wed, 3 Jul 2019 21:47:11 +0800 Subject: [PATCH] Fix comments. --- pkg/transport/log.go | 2 +- pkg/transport/managed_transport.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/transport/log.go b/pkg/transport/log.go index b5a07182e..1983b0ab4 100644 --- a/pkg/transport/log.go +++ b/pkg/transport/log.go @@ -92,7 +92,7 @@ func (tls *inMemoryTransportLogStore) Entry(id uuid.UUID) (*LogEntry, error) { entry, ok := tls.entries[id] tls.mu.Unlock() if !ok { - return entry, errors.New("not found") + return entry, errors.New("transport log entry not found") } return entry, nil diff --git a/pkg/transport/managed_transport.go b/pkg/transport/managed_transport.go index cfab50ade..66a675fa5 100644 --- a/pkg/transport/managed_transport.go +++ b/pkg/transport/managed_transport.go @@ -34,7 +34,7 @@ func newManagedTransport(tr Transport, entry Entry, accepted bool) *ManagedTrans } } -// Read reads using underlying +// Read reads using underlying transport. func (tr *ManagedTransport) Read(p []byte) (n int, err error) { tr.mu.RLock() n, err = tr.Transport.Read(p) @@ -51,7 +51,7 @@ func (tr *ManagedTransport) Read(p []byte) (n int, err error) { return } -// Write writes to an underlying +// Write writes to an underlying transport. func (tr *ManagedTransport) Write(p []byte) (n int, err error) { tr.mu.RLock() n, err = tr.Transport.Write(p) @@ -81,7 +81,7 @@ func (tr *ManagedTransport) killUpdate() { tr.mu.Unlock() } -// Close closes underlying +// Close closes underlying transport and kills worker. func (tr *ManagedTransport) Close() error { if tr == nil { return nil