Skip to content

Commit

Permalink
add field comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkRosemaker committed Dec 20, 2024
1 parent 1dd691f commit ec59299
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ var _ pathWriter = (*ErrIndex)(nil)

// ErrIndex is an error that occurred in a slice. It contains the index of the element.
type ErrIndex struct {
// The index of the slice where the error occurred.
Index int
Err error
// The underlying error.
Err error
}

// Error returns the index and the error message.
Expand Down
2 changes: 2 additions & 0 deletions key.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ var _ pathWriter = (*ErrKey)(nil)

// ErrKey is an error that occurred in a map. It contains the key of the element.
type ErrKey struct {
// The key of the map where the error occurred.
Key string
// The underlying error.
Err error
}

Expand Down

0 comments on commit ec59299

Please sign in to comment.