diff --git a/component.go b/component.go index e6b832c..49021ca 100644 --- a/component.go +++ b/component.go @@ -7,7 +7,6 @@ import ( "fmt" "strings" - "github.com/multiformats/go-multiaddr" "github.com/multiformats/go-varint" ) @@ -79,7 +78,7 @@ func (c *Component) Protocols() []Protocol { func (c *Component) ValueForProtocol(code int) (string, error) { if c.protocol.Code != code { - return "", multiaddr.ErrProtocolNotFound + return "", ErrProtocolNotFound } return c.Value(), nil } @@ -110,7 +109,7 @@ func (c *Component) String() string { return b.String() } -// writeTo is an efficient, private function for string-formatting a multiaddr. +// writeTo is an efficient, private function for string-formatting a multiprotocol. // Trust me, we tend to allocate a lot when doing this. func (c *Component) writeTo(b *strings.Builder) { b.WriteByte('/') @@ -123,7 +122,7 @@ func (c *Component) writeTo(b *strings.Builder) { b.WriteString(value) } -// NewComponent constructs a new multiaddr component +// NewComponent constructs a new multiprotocol component func NewComponent(protocol, value string) (*Component, error) { p := ProtocolWithName(protocol) if p.Code == 0 { diff --git a/multiprotocol.go b/multiprotocol.go index ec0c055..fdcf85d 100644 --- a/multiprotocol.go +++ b/multiprotocol.go @@ -137,7 +137,7 @@ func (m *multiprotocol) Protocols() []Protocol { return ps } -var ErrProtocolNotFound = fmt.Errorf("protocol not found in multiaddr") +var ErrProtocolNotFound = fmt.Errorf("protocol not found in multiprotocol") func (m *multiprotocol) ValueForProtocol(code int) (value string, err error) { err = ErrProtocolNotFound diff --git a/protocol.go b/protocol.go index 0c95cb2..08c7868 100644 --- a/protocol.go +++ b/protocol.go @@ -42,7 +42,7 @@ type Protocol struct { var protocolsByName = map[string]Protocol{} var protocolsByCode = map[int]Protocol{} -// Protocols is the list of multiaddr protocols supported by this module. +// Protocols is the list of multiprotocol protocols supported by this module. var Protocols = []Protocol{} func AddProtocol(p Protocol) error {