1 package ldvalue 2 3 // JSONStringer is a common interface defining the JSONString() method, a convenience for 4 // marshaling a value to JSON and getting the result as a string. 5 type JSONStringer interface { 6 // JSONString returns the JSON representation of the value as a string. This is 7 // guaranteed to be logically equivalent to calling json.Marshal() and converting 8 // the first return value to a string. 9 // 10 // Since types that support this method are by definition always convertible to JSON, 11 // it does not need to return an error value so it can be easily used within an 12 // expression. 13 JSONString() string 14 } 15