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: sequence.go
    path of file: ./repos/go-arg
    
    the code of the file until where you have to start completion: package arg

import (
	"fmt"
	"reflect"
	"strings"

	scalar "github.com/alexflint/go-scalar"
)

// setSliceOrMap parses a sequence of strings into a slice or map. If clear is
// true then any values already in the slice or map are first removed.
func setSliceOrMap(dest reflect.Value
    
func setMap(dest reflect.Value, values []string, clear bool) error {
	// determine the key and value type
	var keyIsPtr bool
	keyType := dest.Type().Key()
	if keyType.Kind() == reflect.Ptr && !keyType.Implements(textUnmarshalerType) {
		keyIsPtr = true
		keyType = keyType.Elem()
	}

	var valIsPtr bool
	valType := dest.Type().Elem()
	if valType.Kind() == reflect.Ptr && !valType.Implements(textUnmarshalerType) {
		valIsPtr = true
		valType = valType.Elem()
	}

	// clear the slice in case default values exist
	if clear && !dest.IsNil() {
		for _, k := range dest.MapKeys() {
			dest.SetMapIndex(k, reflect.Value{})
		}
	}

	// allocate the map if it is not allocated
	if dest.IsNil() {
		dest.Set(reflect.MakeMap(dest.Type()))
	}

	// parse the values one-by-one
	for _, s := range values {
		// split at the first equals sign
		pos := strings.Index(s, "=")
		if pos == -1 {
			return fmt.Errorf("cannot parse %q into a map, expected format key=value", s)
		}

		// parse the key
		k := reflect.New(keyType)
		if err := scalar.ParseValue(k.Elem(), s[:pos]); err != nil {
			return err
		}
		if !keyIsPtr {
			k = k.Elem()
		}

		// parse the value
		v := reflect.New(valType)
		if err := scalar.ParseValue(v.Elem(), s[pos+1:]); err != nil {
			return err
		}
		if !valIsPtr {
			v = v.Elem()
		}

		// add it to the map
		dest.SetMapIndex(k, v)
	}
	return nil
}