Michael Stapelberg c69658e234 proto: extend Marshal documentation, include an example
The example has been written so that it can be run, meaning it only uses
packages that are included in the protobuf module (durationpb specifically).

I included an Output: comment in the example so that pkgsite displays the
program output even without having to run it (but running it is of course
possible).

I added a brief tip to protoscope, which is often mentioned in the protobuf.dev
docs for illustrative purposes, and I think it really makes much clearer to the
reader how the protobuf wire format looks like and what information survives the
encoding process (field numbers and their values, but not field names like in
JSON).

The struct literal contains only one field so that we don’t need to marshal this
message deterministically for stable wire format, which is not the point of the
example and would be distracting.

The value was chosen such that the wire format hex representation contains at
least one byte that is clearly identifiable as hexadecimal, to avoid confusion.

Change-Id: I86103abfd7d5b3f654aca3bfbb452f8ef7e49828
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/574455
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Lasse Folger <lassefolger@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-03-27 09:10:56 +00:00
..
2022-05-19 09:32:38 +00:00
2023-09-05 14:55:28 +00:00
2023-09-05 14:55:28 +00:00
2023-09-05 14:55:28 +00:00
2023-09-05 14:55:28 +00:00
2022-01-04 22:57:54 +00:00
2020-04-23 06:01:13 +00:00
2022-01-04 22:57:54 +00:00
2022-01-04 22:57:54 +00:00
2023-09-05 14:55:28 +00:00