Commit 40bacb4f authored by Eric Myhre's avatar Eric Myhre

Fix docs references missed by exact string match.

Signed-off-by: default avatarEric Myhre <hash@exultant.us>
parent 2e3868c1
......@@ -9,7 +9,7 @@ import (
// that node concretely contains.
//
// For example, calling AsString on a map will return ErrWrongKind.
// Calling LookupString on an int will similarly return ErrWrongKind.
// Calling Lookup on an int will similarly return ErrWrongKind.
type ErrWrongKind struct {
// CONSIDER: if we should add a `TypeName string` here as well?
// It seems to be useful information, and in many places we've shoved it
......@@ -36,8 +36,8 @@ func (e ErrWrongKind) Error() string {
return fmt.Sprintf("func called on wrong kind: %s called on a %s node, but only makes sense on %s", e.MethodName, e.ActualKind, e.AppropriateKind)
}
// ErrNotExists may be returned from the traversal functions of the Node
// interface to indicate a missing value.
// ErrNotExists may be returned from the lookup functions of the Node interface
// to indicate a missing value.
//
// Note that typed.ErrNoSuchField is another type of error which sometimes
// occurs in similar places as ErrNotExists. ErrNoSuchField is preferred
......
......@@ -9,7 +9,7 @@ import (
// which makes chaining calls easier.
//
// The very first error value encountered will be stored, and can be viewed later.
// After an error is encountered, all subsequent traversal methods will
// After an error is encountered, all subsequent lookup methods will
// silently return the same error-storing node.
// Any of the terminal scalar-returning methods will panic if an error is stored.
// (The fluent.Recover function can be used to nicely gather these panics.)
......
......@@ -10,7 +10,7 @@ import (
)
func TestRecover(t *testing.T) {
t.Run("simple traversal error should capture", func(t *testing.T) {
t.Run("simple lookup error should capture", func(t *testing.T) {
Wish(t,
Recover(func() {
WrapNode(&ipldfree.Node{}).LookupIndex(0).AsString()
......@@ -20,7 +20,7 @@ func TestRecover(t *testing.T) {
Error{ipld.ErrWrongKind{MethodName: "LookupIndex", AppropriateKind: ipld.ReprKindSet_JustList, ActualKind: ipld.ReprKind_Invalid}},
)
})
t.Run("correct traversal should return nil", func(t *testing.T) {
t.Run("correct lookup should return nil", func(t *testing.T) {
Wish(t,
Recover(func() {
n, _ := ipldfree.NodeBuilder().CreateString("foo")
......
......@@ -6,7 +6,7 @@ import (
"github.com/ipld/go-ipld-prime/schema"
)
// ErrNoSuchField may be returned from traversal functions on the Node
// ErrNoSuchField may be returned from lookup functions on the Node
// interface when a field is requested which doesn't exist, or from Insert
// on a MapBuilder when a key doesn't match a field name in the structure.
type ErrNoSuchField struct {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment