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: default.go
    path of file: ./repos/buildkit/vendor/google.golang.org/protobuf/internal/encoding/defval
    
    the code of the file until where you have to start completion: // Copyright 2018 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 defval marshals and unmarshals textual forms of default values.
//
// This package handles both the form historically used in Go struct field tags
// and also the form used by google.protobuf.FieldDescriptorProto.default_value
// since they differ in superficial ways.
package defval

import (
	"fmt"
	"math"
	"strconv"

	ptext "google.golang.org/protobuf/internal/encoding/text"
	"google.golang.org/protobuf/internal/errors"
	"google.golang.org/protobuf/reflect/protoreflect"
)

// Format is the serialization format used to represent the default value.
type Format int

const (
	_ Format = iota

	// Descriptor uses the serialization format that protoc uses with the
	// google.protobuf.FieldDescriptorProto.default_value field.
	Descriptor

	// GoTag uses the historical serialization format in Go struct field tags.
	GoTag
)

// Unmarshal deserializes the
    
func Unmarshal(s string, k protoreflect.Kind, evs protoreflect.EnumValueDescriptors, f Format) (protoreflect.Value, protoreflect.EnumValueDescriptor, error) {
	switch k {
	case protoreflect.BoolKind:
		if f == GoTag {
			switch s {
			case "1":
				return protoreflect.ValueOfBool(true), nil, nil
			case "0":
				return protoreflect.ValueOfBool(false), nil, nil
			}
		} else {
			switch s {
			case "true":
				return protoreflect.ValueOfBool(true), nil, nil
			case "false":
				return protoreflect.ValueOfBool(false), nil, nil
			}
		}
	case protoreflect.EnumKind:
		if f == GoTag {
			// Go tags use the numeric form of the enum value.
			if n, err := strconv.ParseInt(s, 10, 32); err == nil {
				if ev := evs.ByNumber(protoreflect.EnumNumber(n)); ev != nil {
					return protoreflect.ValueOfEnum(ev.Number()), ev, nil
				}
			}
		} else {
			// Descriptor default_value use the enum identifier.
			ev := evs.ByName(protoreflect.Name(s))
			if ev != nil {
				return protoreflect.ValueOfEnum(ev.Number()), ev, nil
			}
		}
	case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind:
		if v, err := strconv.ParseInt(s, 10, 32); err == nil {
			return protoreflect.ValueOfInt32(int32(v)), nil, nil
		}
	case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
		if v, err := strconv.ParseInt(s, 10, 64); err == nil {
			return protoreflect.ValueOfInt64(int64(v)), nil, nil
		}
	case protoreflect.Uint32Kind, protoreflect.Fixed32Kind:
		if v, err := strconv.ParseUint(s, 10, 32); err == nil {
			return protoreflect.ValueOfUint32(uint32(v)), nil, nil
		}
	case protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
		if v, err := strconv.ParseUint(s, 10, 64); err == nil {
			return protoreflect.ValueOfUint64(uint64(v)), nil, nil
		}
	case protoreflect.FloatKind, protoreflect.DoubleKind:
		var v float64
		var err error
		switch s {
		case "-inf":
			v = math.Inf(-1)
		case "inf":
			v = math.Inf(+1)
		case "nan":
			v = math.NaN()
		default:
			v, err = strconv.ParseFloat(s, 64)
		}
		if err == nil {
			if k == protoreflect.FloatKind {
				return protoreflect.ValueOfFloat32(float32(v)), nil, nil
			} else {
				return protoreflect.ValueOfFloat64(float64(v)), nil, nil
			}
		}
	case protoreflect.StringKind:
		// String values are already unescaped and can be used as is.
		return protoreflect.ValueOfString(s), nil, nil
	case protoreflect.BytesKind:
		if b, ok := unmarshalBytes(s); ok {
			return protoreflect.ValueOfBytes(b), nil, nil
		}
	}
	return protoreflect.Value{}, nil, errors.New("could not parse value for %v: %q", k, s)
}