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: fix.go
    path of file: ./repos/devspace/vendor/sigs.k8s.io/kustomize/api/types
    
    the code of the file until where you have to start completion: // Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0

package types

import (
	"regexp"

	"sigs.k8s.io/yaml"
)

// FixKustomizationPreUnmarshalling modifies the raw data
// before marshalling - e.g. changes old field names to
// new field n
    
func useLegacyPatch(data []byte) (bool, error) {
	found := false
	var object map[string]interface{}
	err := yaml.Unmarshal(data, &object)
	if err != nil {
		return false, err
	}
	if rawPatches, ok := object["patches"]; ok {
		patches, ok := rawPatches.([]interface{})
		if !ok {
			return false, err
		}
		for _, p := range patches {
			_, ok := p.(string)
			if ok {
				found = true
			}
		}
	}
	return found, nil
}