Skip to content

Commit

Permalink
agherr: imp docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ainar-g committed Mar 16, 2021
1 parent f43a5f5 commit c812999
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions internal/agherr/agherr.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ type manyError struct {
}

// Many wraps several errors and returns a single error.
//
// TODO(a.garipov): Add formatting to message.
func Many(message string, underlying ...error) (err error) {
err = &manyError{
message: message,
Expand Down Expand Up @@ -92,6 +94,7 @@ type wrapper interface {
// // …
// }
//
// msg must contain the final ": %w" verb.
func Annotate(msg string, errPtr *error, args ...interface{}) {
if errPtr == nil {
return
Expand Down
2 changes: 1 addition & 1 deletion internal/agherr/agherr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestAnnotate(t *testing.T) {
const s = "1234"
const wantMsg = `bad string "1234": test`

// Don't use const, because we can't take a pointer of a contant.
// Don't use const, because we can't take a pointer of a constant.
var errTest error = Error("test")

t.Run("nil", func(t *testing.T) {
Expand Down

0 comments on commit c812999

Please sign in to comment.