diff options
Diffstat (limited to 'methods_test.go')
-rw-r--r-- | methods_test.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/methods_test.go b/methods_test.go index 8280a94..a74532c 100644 --- a/methods_test.go +++ b/methods_test.go @@ -15,10 +15,17 @@ import ( "git.lukeshu.com/go/lowmemjson" ) +type ShortSum string + +func (s ShortSum) EncodeJSON(w io.Writer) error { + // Test that it's OK to call lowmemjson.Encode for the top-level value in a method. + return lowmemjson.Encode(w, string(s)) +} + type SumRun struct { ChecksumSize int `json:",omitempty"` Addr int64 `json:",omitempty"` - Sums string + Sums ShortSum } type SumRunWithGaps struct { |