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: types.go
    path of file: ./repos/gotosocial/vendor/github.com/vmihailenco/msgpack/v5
    
    the code of the file until where you have to start completion: package msgpack

import (
	"encoding"
	"fmt"
	"log"
	"reflect"
	"sync"

	"github.com/vmihailenco/tagparser/v2"
)

var errorType = reflect.TypeOf((*error)(nil)).Elem()
    
func getFields(typ reflect.Type, fallbackTag string) *fields {
	fs := newFields(typ)

	var omitEmpty bool
	for i := 0; i < typ.NumField(); i++ {
		f := typ.Field(i)

		tagStr := f.Tag.Get(defaultStructTag)
		if tagStr == "" && fallbackTag != "" {
			tagStr = f.Tag.Get(fallbackTag)
		}

		tag := tagparser.Parse(tagStr)
		if tag.Name == "-" {
			continue
		}

		if f.Name == "_msgpack" {
			fs.AsArray = tag.HasOption("as_array") || tag.HasOption("asArray")
			if tag.HasOption("omitempty") {
				omitEmpty = true
			}
		}

		if f.PkgPath != "" && !f.Anonymous {
			continue
		}

		field := &field{
			name:      tag.Name,
			index:     f.Index,
			omitEmpty: omitEmpty || tag.HasOption("omitempty"),
		}

		if tag.HasOption("intern") {
			switch f.Type.Kind() {
			case reflect.Interface:
				field.encoder = encodeInternedInterfaceValue
				field.decoder = decodeInternedInterfaceValue
			case reflect.String:
				field.encoder = encodeInternedStringValue
				field.decoder = decodeInternedStringValue
			default:
				err := fmt.Errorf("msgpack: intern strings are not supported on %s", f.Type)
				panic(err)
			}
		} else {
			field.encoder = getEncoder(f.Type)
			field.decoder = getDecoder(f.Type)
		}

		if field.name == "" {
			field.name = f.Name
		}

		if f.Anonymous && !tag.HasOption("noinline") {
			inline := tag.HasOption("inline")
			if inline {
				inlineFields(fs, f.Type, field, fallbackTag)
			} else {
				inline = shouldInline(fs, f.Type, field, fallbackTag)
			}

			if inline {
				if _, ok := fs.Map[field.name]; ok {
					log.Printf("msgpack: %s already has field=%s", fs.Type, field.name)
				}
				fs.Map[field.name] = field
				continue
			}
		}

		fs.Add(field)

		if alias, ok := tag.Options["alias"]; ok {
			fs.warnIfFieldExists(alias)
			fs.Map[alias] = field
		}
	}
	return fs
}