You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: decode.go
    path of file: ./repos/hubble-ui/backend/vendor/sigs.k8s.io/json/internal/golang/encoding/json
    
    the code of the file until where you have to start completion: // Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Represents JSON data structure using native Go types: booleans, floats,
// strings, arrays, and maps.

package json

import (
	"encoding"
	"encoding/base64"
	"fmt"
	"reflect"
	"strconv"
	"strings"
	"unicode"
	"unicode/utf16"
	"unicode/utf8"
)

// Unmarshal parses the JSON-encoded data and stores the result
// in the value pointed to by v. If v is nil or not a pointer,
// Unmarshal returns an In
    
func (d *decodeState) object(v reflect.Value) error {
	// Check for unmarshaler.
	u, ut, pv := indirect(v, false)
	if u != nil {
		start := d.readIndex()
		d.skip()
		return u.UnmarshalJSON(d.data[start:d.off])
	}
	if ut != nil {
		d.saveError(&UnmarshalTypeError{Value: "object", Type: v.Type(), Offset: int64(d.off)})
		d.skip()
		return nil
	}
	v = pv
	t := v.Type()

	// Decoding into nil interface? Switch to non-reflect code.
	if v.Kind() == reflect.Interface && v.NumMethod() == 0 {
		oi := d.objectInterface()
		v.Set(reflect.ValueOf(oi))
		return nil
	}

	var fields structFields
	var checkDuplicateField func(fieldNameIndex int, fieldName string)

	// Check type of target:
	//   struct or
	//   map[T1]T2 where T1 is string, an integer type,
	//             or an encoding.TextUnmarshaler
	switch v.Kind() {
	case reflect.Map:
		// Map key must either have string kind, have an integer kind,
		// or be an encoding.TextUnmarshaler.
		switch t.Key().Kind() {
		case reflect.String,
			reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
			reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
		default:
			if !reflect.PointerTo(t.Key()).Implements(textUnmarshalerType) {
				d.saveError(&UnmarshalTypeError{Value: "object", Type: t, Offset: int64(d.off)})
				d.skip()
				return nil
			}
		}
		if v.IsNil() {
			v.Set(reflect.MakeMap(t))
		}

		if d.disallowDuplicateFields {
			var seenKeys map[string]struct{}
			checkDuplicateField = func(fieldNameIndex int, fieldName string) {
				if seenKeys == nil {
					seenKeys = map[string]struct{}{}
				}
				if _, seen := seenKeys[fieldName]; seen {
					d.saveStrictError(d.newFieldError(duplicateStrictErrType, fieldName))
				} else {
					seenKeys[fieldName] = struct{}{}
				}
			}
		}

	case reflect.Struct:
		fields = cachedTypeFields(t)

		if d.disallowDuplicateFields {
			if len(fields.list) <= 64 {
				// bitset by field index for structs with <= 64 fields
				var seenKeys uint64
				checkDuplicateField = func(fieldNameIndex int, fieldName string) {
					if seenKeys&(1<<fieldNameIndex) != 0 {
						d.saveStrictError(d.newFieldError(duplicateStrictErrType, fieldName))
					} else {
						seenKeys = seenKeys | (1 << fieldNameIndex)
					}
				}
			} else {
				// list of seen field indices for structs with greater than 64 fields
				var seenIndexes []bool
				checkDuplicateField = func(fieldNameIndex int, fieldName string) {
					if seenIndexes == nil {
						seenIndexes = make([]bool, len(fields.list))
					}
					if seenIndexes[fieldNameIndex] {
						d.saveStrictError(d.newFieldError(duplicateStrictErrType, fieldName))
					} else {
						seenIndexes[fieldNameIndex] = true
					}
				}
			}
		}

		// ok
	default:
		d.saveError(&UnmarshalTypeError{Value: "object", Type: t, Offset: int64(d.off)})
		d.skip()
		return nil
	}

	var mapElem reflect.Value
	var origErrorContext errorContext
	if d.errorContext != nil {
		origErrorContext = *d.errorContext
	}
	origStrictFieldStackLen := len(d.strictFieldStack)

	for {
		// Read opening " of string key or closing }.
		d.scanWhile(scanSkipSpace)
		if d.opcode == scanEndObject {
			// closing } - can only happen on first iteration.
			break
		}