...

Source file src/github.com/json-iterator/go/value_tests/raw_message_test.go

Documentation: github.com/json-iterator/go/value_tests

     1  package test
     2  
     3  import (
     4  	"encoding/json"
     5  )
     6  
     7  func init() {
     8  	marshalCases = append(marshalCases,
     9  		json.RawMessage("{}"),
    10  		json.RawMessage("12345"),
    11  		json.RawMessage("3.14"),
    12  		json.RawMessage("-0.5e10"),
    13  		struct {
    14  			Env   string          `json:"env"`
    15  			Extra json.RawMessage `json:"extra,omitempty"`
    16  		}{
    17  			Env: "jfdk",
    18  		},
    19  	)
    20  	unmarshalCases = append(unmarshalCases, unmarshalCase{
    21  		ptr:   (*json.RawMessage)(nil),
    22  		input: `[1,2,3]`,
    23  	}, unmarshalCase{
    24  		ptr:   (*json.RawMessage)(nil),
    25  		input: `1.122e+250`,
    26  	})
    27  }
    28  

View as plain text