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: legacy_export.go
    path of file: ./repos/streamdal/apps/cli/vendor/google.golang.org/protobuf/internal/impl
    
    the code of the file until where you have to start completion: // Copyright 2019 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.

package impl

import (
	"encoding/binary"
	"encoding/json"
	"hash/crc32"
	"math"
	"reflect"

	"google.golang.org/protobuf/internal/errors"
	"google.golang.org/protobuf/reflect/protoreflect"
	"google.golang.org/protobuf/runtime/protoiface"
)

// These functions exist to support exported APIs in generated protobufs.
// While these are deprecated, they cannot be removed for comp
    
func (Export) UnmarshalJSONEnum(ed protoreflect.EnumDescriptor, b []byte) (protoreflect.EnumNumber, error) {
	if b[0] == '"' {
		var name protoreflect.Name
		if err := json.Unmarshal(b, &name); err != nil {
			return 0, errors.New("invalid input for enum %v: %s", ed.FullName(), b)
		}
		ev := ed.Values().ByName(name)
		if ev == nil {
			return 0, errors.New("invalid value for enum %v: %s", ed.FullName(), name)
		}
		return ev.Number(), nil
	} else {
		var num protoreflect.EnumNumber
		if err := json.Unmarshal(b, &num); err != nil {
			return 0, errors.New("invalid input for enum %v: %s", ed.FullName(), b)
		}
		return num, nil
	}
}