protoutil: add NewAny method for deterministic serialization (#2462)

This commit is contained in:
Caleb Doxsey 2021-08-09 17:51:57 -06:00 committed by GitHub
parent b051c7db03
commit 6af0655206
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 90 additions and 148 deletions

View file

@ -39,10 +39,7 @@ func (t transformer) transformAny(dst, src *anypb.Any) error {
return err
}
a, err := anypb.New(dstMsg.Interface())
if err != nil {
return err
}
a := NewAny(dstMsg.Interface())
dst.TypeUrl = a.TypeUrl
dst.Value = a.Value
return nil