...

Source file src/github.com/json-iterator/go/any_tests/jsoniter_any_null_test.go

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

     1  package any_tests
     2  
     3  import (
     4  	"github.com/json-iterator/go"
     5  	"github.com/stretchr/testify/require"
     6  	"testing"
     7  )
     8  
     9  func Test_read_null_as_any(t *testing.T) {
    10  	should := require.New(t)
    11  	any := jsoniter.Get([]byte(`null`))
    12  	should.Equal(0, any.ToInt())
    13  	should.Equal(float64(0), any.ToFloat64())
    14  	should.Equal("", any.ToString())
    15  	should.False(any.ToBool())
    16  }
    17  

View as plain text