Skip to content

Commit c0af7cd

Browse files
seankhliaogopherbot
authored andcommitted
encoding: document when marshaling methods can be added
Fixes #10275 Change-Id: I2b3d54f3eb0f85d65324ddc3c3b2a797d42a16c9 Reviewed-on: https://go-review.googlesource.com/c/go/+/496537 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]>
1 parent 3c3a883 commit c0af7cd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/encoding/encoding.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
// interface once can make a type useful in multiple encodings.
1010
// Standard types that implement these interfaces include time.Time and net.IP.
1111
// The interfaces come in pairs that produce and consume encoded data.
12+
//
13+
// Adding encoding/decoding methods to existing types may constitute a breaking change,
14+
// as they can be used for serialization in communicating with programs
15+
// written with different library versions.
16+
// The policy for packages maintained by the Go project is to only allow
17+
// the addition of marshaling functions if no existing, reasonable marshaling exists.
1218
package encoding
1319

1420
// BinaryMarshaler is the interface implemented by an object that can

0 commit comments

Comments
 (0)