@@ -261,6 +261,10 @@ func IsNotEnabled(err error) bool {
261
261
// T is similar as [To] but it let's you to annotate a possible error at place.
262
262
//
263
263
// try.T(f.Close)("annotations")
264
+ //
265
+ // Note that T is a helper, which means that you start with it randomly. You
266
+ // start with [To] and end up using T if you really need to add context
267
+ // related to a specific error check, which is a very rare case.
264
268
func T (err error ) func (fs string ) {
265
269
return func (fs string ) {
266
270
if err == nil {
@@ -273,6 +277,10 @@ func T(err error) func(fs string) {
273
277
// T1 is similar as [To1] but it let's you to annotate a possible error at place.
274
278
//
275
279
// f := try.T1(os.Open("filename")("cannot open cfg file")
280
+ //
281
+ // Note that T1 is a helper, which means that you start with it randomly. You
282
+ // start with [To1] and end up using T1 if you really need to add context
283
+ // related to a specific error check, which is a very rare case.
276
284
func T1 [T any ](v T , err error ) func (fs string ) T {
277
285
return func (fs string ) T {
278
286
if err == nil {
@@ -283,6 +291,10 @@ func T1[T any](v T, err error) func(fs string) T {
283
291
}
284
292
285
293
// T2 is similar as [To2] but it let's you to annotate a possible error at place.
294
+ //
295
+ // Note that T2 is a helper, which means that you start with it randomly. You
296
+ // start with [To2] and end up using T2 if you really need to add context
297
+ // related to a specific error check, which is a very rare case.
286
298
func T2 [T , U any ](v T , u U , err error ) func (fs string ) (T , U ) {
287
299
return func (fs string ) (T , U ) {
288
300
if err == nil {
@@ -298,6 +310,10 @@ func annotateErr(err error, fs string) error {
298
310
}
299
311
300
312
// T3 is similar as [To3] but it let's you to annotate a possible error at place.
313
+ //
314
+ // Note that T3 is a helper, which means that you start with it randomly. You
315
+ // start with [To3] and end up using T3 if you really need to add context
316
+ // related to a specific error check, which is a very rare case.
301
317
func T3 [T , U , V any ](v1 T , v2 U , v3 V , err error ) func (fs string ) (T , U , V ) {
302
318
return func (fs string ) (T , U , V ) {
303
319
if err == nil {
0 commit comments