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: cache.go
    path of file: ./repos/sealos/controllers/account/controllers/cache
    
    the code of the file until where you have to start completion: // Copyright Â© 2023 sealos.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agre
    
func SetupCache(mgr ctrl.Manager) error {
	account := &accountv1.Account{}
	accountNameFunc := func(obj client.Object) []string {
		return []string{obj.(*accountv1.Account).Name}
	}
	ns := &corev1.Namespace{}
	nsNameFunc := func(obj client.Object) []string {
		return []string{obj.(*corev1.Namespace).Name}
	}
	nsOwnerFunc := func(obj client.Object) []string {
		return []string{obj.(*corev1.Namespace).Labels[v1.UserLabelOwnerKey]}
	}

	for _, idx := range []struct {
		obj          client.Object
		field        string
		extractValue client.IndexerFunc
	}{
		{ns, accountv1.Name, nsNameFunc},
		{ns, accountv1.Owner, nsOwnerFunc},
		{account, accountv1.Name, accountNameFunc}} {
		if err := mgr.GetFieldIndexer().IndexField(context.TODO(), idx.obj, idx.field, idx.extractValue); err != nil {
			return err
		}
	}
	return nil
}