Skip to content

Commit

Permalink
encoding/json: use Deprecated markers
Browse files Browse the repository at this point in the history
In golang#10909, it was decided that "Deprecated:" is a magic string for
tools (e.g., golang#17056 for godoc) to detect deprecated identifiers.
Use those convention instead of custom written prose.

Change-Id: Ia514fc3c88fc502e86c6e3de361c435f4cb80b22
Reviewed-on: https://go-review.googlesource.com/70110
Reviewed-by: Ian Lance Taylor <[email protected]>
Run-TryBot: Joe Tsai <[email protected]>
  • Loading branch information
dsnet committed Oct 11, 2017
1 parent edcf2d0 commit a3e013b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/encoding/json/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ func (e *UnmarshalTypeError) Error() string {

// An UnmarshalFieldError describes a JSON object key that
// led to an unexported (and therefore unwritable) struct field.
// (No longer used; kept for compatibility.)
//
// Deprecated: No longer used; kept for compatibility.
type UnmarshalFieldError struct {
Key string
Type reflect.Type
Expand Down
4 changes: 2 additions & 2 deletions src/encoding/json/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ func (e *UnsupportedValueError) Error() string {
// attempting to encode a string value with invalid UTF-8 sequences.
// As of Go 1.2, Marshal instead coerces the string to valid UTF-8 by
// replacing invalid bytes with the Unicode replacement rune U+FFFD.
// This error is no longer generated but is kept for backwards compatibility
// with programs that might mention it.
//
// Deprecated: No longer used; kept for compatibility.
type InvalidUTF8Error struct {
S string // the whole string value that caused the error
}
Expand Down

0 comments on commit a3e013b

Please sign in to comment.