Commit 4247b1b
proto: Add CloneOf[M Message](m M) M
This allows writing:
`copy := proto.CloneOf(orig)`
instead of the previous:
`copy := proto.Clone(orig).(*pb.MyMessage)`
Fixes golang/protobuf#1594
Change-Id: I7b8b712b6e59607ccc339720ee3c146e8a7ea28b
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/653536
Reviewed-by: Cassondra Foesch <cfoesch@gmail.com>
Reviewed-by: Michael Stapelberg <stapelberg@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>1 parent f7fcf5b commit 4247b1b
2 files changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
853 | 853 | | |
854 | 854 | | |
855 | 855 | | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
856 | 866 | | |
857 | 867 | | |
858 | 868 | | |
| |||
0 commit comments