Skip to content

Commit

Permalink
Add note about only v2 API
Browse files Browse the repository at this point in the history
  • Loading branch information
arjan-bal committed Oct 10, 2024
1 parent 31d53ae commit 3b088a0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,13 @@ func (s *Status) Details() []any {
// that the type is wrapped in a MessageV1 wrapper again before
// returning. Note that protoc-gen-go doesn't generate code which
// implements ONLY MessageV2 at the time of writing.
//
// NOTE: Status details can also be added using the FromProto method.
// This could theoretically allow passing a Detail message that only
// implements the V2 API. In such a case the message will be wrapped in
// a MessageV1 wrapper when fetched using Details().
// Since protoc-gen-go generates only code that implements both V1 and
// V2 APIs for backward compatibility, this is not a concern.
details = append(details, protoadapt.MessageV1Of(detail))
}
return details
Expand Down

0 comments on commit 3b088a0

Please sign in to comment.