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: watcher.go
    path of file: ./repos/istio/pkg/config/mesh/kubemesh
    
    the code of the file until where you have to start completion: // Copyright Istio Authors
//
// 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 agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package kubemesh

import (
	"fmt"

	v1 "k8s.io/api/core/v1"

	meshconfig "istio.io/api/mesh/v1alpha1"
	"istio.io/istio/pkg/config/mesh"
	"istio.io/istio/pkg/kube"
	"istio.io/istio/pkg/kube/watcher/configmapwatcher"
	"istio.io/istio/pkg/log"
)

// NewConfigMapWatcher creates a new Watcher for changes to the given ConfigMap.
func NewConfigMapWatcher(client kube.Client, namespace, name, key string, multiWatch bool, st
    
func NewConfigMapWatcher(client kube.Client, namespace, name, key string, multiWatch bool, stop <-chan struct{}) *mesh.MultiWatcher {
	w := mesh.NewMultiWatcher(mesh.DefaultMeshConfig())
	c := configmapwatcher.NewController(client, namespace, name, func(cm *v1.ConfigMap) {
		meshNetworks, err := ReadNetworksConfigMap(cm, "meshNetworks")
		if err != nil {
			// Keep the last known config in case there's a misconfiguration issue.
			log.Errorf("failed to read meshNetworks config from ConfigMap: %v", err)
			return
		}
		if meshNetworks != nil {
			w.SetNetworks(meshNetworks)
		}
		if multiWatch {
			meshConfig := meshConfigMapData(cm, key)
			w.HandleMeshConfigData(meshConfig)
			return
		}
		// Original behavior - just per-revision config
		meshConfig, err := ReadConfigMap(cm, key)
		if err != nil {
			// Keep the last known config in case there's a misconfiguration issue.
			log.Errorf("failed to read mesh config from ConfigMap: %v", err)
			return
		}
		w.HandleMeshConfig(meshConfig)
	})

	go c.Run(stop)

	// Ensure the ConfigMap is initially loaded if present.
	if !client.WaitForCacheSync("configmap watcher", stop, c.HasSynced) {
		log.Error("failed to wait for cache sync")
	}
	return w
}