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: file_format.go
    path of file: ./repos/gitea/modules/migration
    
    the code of the file until where you have to start completion: // Copyright 2022 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT

package migration

import (
	"fmt"
	"os"
	"strings"
	"time"

	"code.gitea.io/gitea/modules/json"
	"code.gitea.io/gitea/modules/log"

	"github.com/santhosh-tekuri/jsonschema/v5"
	"gopkg.in/yaml.v3"
)

// Load project data from file, with optional validation
func Load(filename string, data any, validation bool) error {
	isJSON := strings.HasSuffix(filename, ".json")

	bs, err := os.ReadFile(filename)
	
    
func validate(bs []byte, datatype any, isJSON bool) error {
	var v any
	err := unmarshal(bs, &v, isJSON)
	if err != nil {
		return err
	}
	if !isJSON {
		v, err = toStringKeys(v)
		if err != nil {
			return err
		}
	}

	var schemaFilename string
	switch datatype := datatype.(type) {
	case *[]*Issue:
		schemaFilename = "issue.json"
	case *[]*Milestone:
		schemaFilename = "milestone.json"
	default:
		return fmt.Errorf("file_format:validate: %T has not a validation implemented", datatype)
	}

	sch, err := getSchema(schemaFilename)
	if err != nil {
		return err
	}
	err = sch.Validate(v)
	if err != nil {
		log.Error("migration validation with %s failed:\n%#v", schemaFilename, err)
	}
	return err
}