1
0
mirror of https://github.com/json-iterator/go.git synced 2025-11-29 22:47:28 +02:00

fix golint: document exported symbols

This commit is contained in:
Tao Wen
2017-07-09 14:57:49 +08:00
parent bede1d7f40
commit ce479f3476
3 changed files with 26 additions and 0 deletions

View File

@@ -36,10 +36,12 @@ func decode(str string) string {
return string(bs)
}
// MarshalJSON TEST ONLY
func (m MarshalerForTest) MarshalJSON() ([]byte, error) {
return []byte(`"MANUAL__` + encode(string(m)) + `"`), nil
}
// UnmarshalJSON TEST ONLY
func (m *MarshalerForTest) UnmarshalJSON(text []byte) error {
*m = MarshalerForTest(decode(strings.TrimPrefix(strings.Trim(string(text), `"`), "MANUAL__")))
return nil

View File

@@ -36,10 +36,12 @@ func decode(str string) string {
return string(bs)
}
// MarshalText TEST ONLY
func (m MarshalerForTest) MarshalText() ([]byte, error) {
return []byte(`MANUAL__` + encode(string(m))), nil
}
// UnmarshalText TEST ONLY
func (m *MarshalerForTest) UnmarshalText(text []byte) error {
*m = MarshalerForTest(decode(strings.TrimPrefix(string(text), "MANUAL__")))
return nil