Skip to content

Commit

Permalink
added documentation to Result structs
Browse files Browse the repository at this point in the history
  • Loading branch information
lainio committed Aug 17, 2023
1 parent 1c0c9de commit a5e430b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion try/out.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,22 @@ type (
// ErrFn is function type for try.OutX handlers.
ErrFn = func(err error) error

// Result is the base of our error handling DSL for try.Out functions.
// Result is the base of our error handling language for try.Out functions.
Result struct {
// Err holds the error value returned from try.Out function result.
Err error
}

// Result1 is the base of our error handling DSL for try.Out1 functions.
Result1[T any] struct {
// Val1 holds the first value returned from try.Out1 function result.
Val1 T
Result
}

// Result2 is the base of our error handling DSL for try.Out2 functions.
Result2[T any, U any] struct {
// Val2 holds the first value returned from try.Out2 function result.
Val2 U
Result1[T]
}
Expand Down

0 comments on commit a5e430b

Please sign in to comment.