@@ -27,15 +27,17 @@ const defaultIndent = " "
27
27
28
28
// Format formats the message as a multiline string.
29
29
// This function is only intended for human consumption and ignores errors.
30
- // Do not depend on the output being stable. It may change over time across
31
- // different versions of the program.
30
+ // Do not depend on the output being stable. Its output will change across
31
+ // different builds of your program, even when using the same version of the
32
+ // protobuf module.
32
33
func Format (m proto.Message ) string {
33
34
return MarshalOptions {Multiline : true }.Format (m )
34
35
}
35
36
36
37
// Marshal writes the given [proto.Message] in textproto format using default
37
- // options. Do not depend on the output being stable. It may change over time
38
- // across different versions of the program.
38
+ // options. Do not depend on the output being stable. Its output will change
39
+ // across different builds of your program, even when using the same version of
40
+ // the protobuf module.
39
41
func Marshal (m proto.Message ) ([]byte , error ) {
40
42
return MarshalOptions {}.Marshal (m )
41
43
}
@@ -84,8 +86,9 @@ type MarshalOptions struct {
84
86
85
87
// Format formats the message as a string.
86
88
// This method is only intended for human consumption and ignores errors.
87
- // Do not depend on the output being stable. It may change over time across
88
- // different versions of the program.
89
+ // Do not depend on the output being stable. Its output will change across
90
+ // different builds of your program, even when using the same version of the
91
+ // protobuf module.
89
92
func (o MarshalOptions ) Format (m proto.Message ) string {
90
93
if m == nil || ! m .ProtoReflect ().IsValid () {
91
94
return "<nil>" // invalid syntax, but okay since this is for debugging
@@ -98,8 +101,9 @@ func (o MarshalOptions) Format(m proto.Message) string {
98
101
}
99
102
100
103
// Marshal writes the given [proto.Message] in textproto format using options in
101
- // MarshalOptions object. Do not depend on the output being stable. It may
102
- // change over time across different versions of the program.
104
+ // MarshalOptions object. Do not depend on the output being stable. Its output
105
+ // will change across different builds of your program, even when using the
106
+ // same version of the protobuf module.
103
107
func (o MarshalOptions ) Marshal (m proto.Message ) ([]byte , error ) {
104
108
return o .marshal (nil , m )
105
109
}
0 commit comments