@@ -15,7 +15,7 @@ import (
1515 "github.com/maxatome/go-testdeep/internal/visited"
1616)
1717
18- // Context is used internally to keep track of the CmpDeeply in-Depth
18+ // Context is used internally to keep track of the Cmp in-depth
1919// traversal.
2020type Context struct {
2121 Path Path
@@ -46,7 +46,7 @@ type Context struct {
4646 IgnoreUnexported bool
4747}
4848
49- // InitErrors initializes Context *Errors slice, if MaxErrors < 0 or
49+ // InitErrors initializes [ Context] *Errors slice, if MaxErrors < 0 or
5050// MaxErrors > 1.
5151func (c * Context ) InitErrors () {
5252 if c .MaxErrors != 0 && c .MaxErrors != 1 {
@@ -55,7 +55,7 @@ func (c *Context) InitErrors() {
5555 }
5656}
5757
58- // ResetErrors returns a new Context without any Error set.
58+ // ResetErrors returns a new [ Context] without any Error set.
5959func (c Context ) ResetErrors () (new Context ) {
6060 new = c
6161 new .InitErrors ()
@@ -65,7 +65,8 @@ func (c Context) ResetErrors() (new Context) {
6565// CollectError collects an error in the context. It returns an error
6666// if the collector is full, nil otherwise.
6767//
68- // In boolean context, ignore the passed error and return the BooleanError.
68+ // In boolean context, it ignores the passed error and returns the
69+ // [BooleanError].
6970func (c Context ) CollectError (err * Error ) * Error {
7071 if err == nil {
7172 return nil
@@ -126,23 +127,23 @@ func (c Context) CannotCompareError() *Error {
126127 }
127128}
128129
129- // AddCustomLevel creates a new Context from current one plus pathAdd.
130+ // AddCustomLevel creates a new [ Context] from current one plus pathAdd.
130131func (c Context ) AddCustomLevel (pathAdd string ) (new Context ) {
131132 new = c
132133 new .Path = new .Path .AddCustomLevel (pathAdd )
133134 new .Depth ++
134135 return
135136}
136137
137- // AddField creates a new Context from current one plus "." + field.
138+ // AddField creates a new [ Context] from current one plus "." + field.
138139func (c Context ) AddField (field string ) (new Context ) {
139140 new = c
140141 new .Path = new .Path .AddField (field )
141142 new .Depth ++
142143 return
143144}
144145
145- // AddArrayIndex creates a new Context from current one plus an array
146+ // AddArrayIndex creates a new [ Context] from current one plus an array
146147// dereference for index-th item.
147148func (c Context ) AddArrayIndex (index int ) (new Context ) {
148149 new = c
@@ -151,7 +152,7 @@ func (c Context) AddArrayIndex(index int) (new Context) {
151152 return
152153}
153154
154- // AddMapKey creates a new Context from current one plus a map
155+ // AddMapKey creates a new [ Context] from current one plus a map
155156// dereference for key key.
156157func (c Context ) AddMapKey (key any ) (new Context ) {
157158 new = c
@@ -160,15 +161,15 @@ func (c Context) AddMapKey(key any) (new Context) {
160161 return
161162}
162163
163- // AddPtr creates a new Context from current one plus a pointer dereference.
164+ // AddPtr creates a new [ Context] from current one plus a pointer dereference.
164165func (c Context ) AddPtr (num int ) (new Context ) {
165166 new = c
166167 new .Path = new .Path .AddPtr (num )
167168 new .Depth ++
168169 return
169170}
170171
171- // AddFunctionCall creates a new Context from current one inside a
172+ // AddFunctionCall creates a new [ Context] from current one inside a
172173// function call.
173174func (c Context ) AddFunctionCall (fn string ) (new Context ) {
174175 new = c
@@ -177,7 +178,7 @@ func (c Context) AddFunctionCall(fn string) (new Context) {
177178 return
178179}
179180
180- // ResetPath creates a new Context from current one but reinitializing Path.
181+ // ResetPath creates a new [ Context] from current one but reinitializing Path.
181182func (c Context ) ResetPath (newRoot string ) (new Context ) {
182183 new = c
183184 new .Path = NewPath (newRoot )
0 commit comments