Sha256: 1cd303d266ed3d3daf6d1ebea16679791cbc86f777b917fd74f5d0157fda4094

Contents?: true

Size: 1014 Bytes

Versions: 16

Compression:

Stored size: 1014 Bytes

Contents

package decoder

import (
	"reflect"
	"unsafe"

	"github.com/goccy/go-json/internal/errors"
	"github.com/goccy/go-json/internal/runtime"
)

type invalidDecoder struct {
	typ        *runtime.Type
	kind       reflect.Kind
	structName string
	fieldName  string
}

func newInvalidDecoder(typ *runtime.Type, structName, fieldName string) *invalidDecoder {
	return &invalidDecoder{
		typ:        typ,
		kind:       typ.Kind(),
		structName: structName,
		fieldName:  fieldName,
	}
}

func (d *invalidDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) error {
	return &errors.UnmarshalTypeError{
		Value:  "object",
		Type:   runtime.RType2Type(d.typ),
		Offset: s.totalOffset(),
		Struct: d.structName,
		Field:  d.fieldName,
	}
}

func (d *invalidDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) {
	return 0, &errors.UnmarshalTypeError{
		Value:  "object",
		Type:   runtime.RType2Type(d.typ),
		Offset: cursor,
		Struct: d.structName,
		Field:  d.fieldName,
	}
}

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ruby_snowflake_client-1.3.7 ext/vendor/github.com/goccy/go-json/internal/decoder/invalid.go
ruby_snowflake_client-1.3.6 ext/vendor/github.com/goccy/go-json/internal/decoder/invalid.go
ruby_snowflake_client-1.3.5 ext/vendor/github.com/goccy/go-json/internal/decoder/invalid.go
ruby_snowflake_client-1.3.4 ext/vendor/github.com/goccy/go-json/internal/decoder/invalid.go
ruby_snowflake_client-1.3.4.pre.debug ext/vendor/github.com/goccy/go-json/internal/decoder/invalid.go
ruby_snowflake_client-1.3.3.pre.debug ext/vendor/github.com/goccy/go-json/internal/decoder/invalid.go
ruby_snowflake_client-1.3.2 ext/vendor/github.com/goccy/go-json/internal/decoder/invalid.go
ruby_snowflake_client-1.3.1 ext/vendor/github.com/goccy/go-json/internal/decoder/invalid.go
ruby_snowflake_client-1.3.0 ext/vendor/github.com/goccy/go-json/internal/decoder/invalid.go
ruby_snowflake_client-1.2.1 ext/vendor/github.com/goccy/go-json/internal/decoder/invalid.go
ruby_snowflake_client-1.2.0 ext/vendor/github.com/goccy/go-json/internal/decoder/invalid.go
ruby_snowflake_client-1.1.1 ext/vendor/github.com/goccy/go-json/internal/decoder/invalid.go
ruby_snowflake_client-1.1.0 ext/vendor/github.com/goccy/go-json/internal/decoder/invalid.go
ruby_snowflake_client-1.0.2 ext/vendor/github.com/goccy/go-json/internal/decoder/invalid.go
ruby_snowflake_client-1.0.1 ext/vendor/github.com/goccy/go-json/internal/decoder/invalid.go
ruby_snowflake_client-1.0.0 ext/vendor/github.com/goccy/go-json/internal/decoder/invalid.go