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: fswatcher.go
    path of file: ./repos/hubble-ui/backend/vendor/github.com/cilium/cilium/pkg/fswatcher
    
    the code of the file until where you have to start completion: // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of Cilium

package fswatcher

import (
	"errors"
	"fmt"
	"os"
	"path/filepath"

	"github.com/fsnotify/fsnotify"
	"github.com/sirupsen/logrus"

	"github.com/cilium/cilium/pkg/counter"
	"github.com/cilium/cilium/pkg/logging"
	"github.com/cilium/cilium/pkg/logging/logfields"
)

var log = logging.DefaultLogger.WithField(logfields.LogSubsys, "fs
    
func New(trackedFiles []string) (*Watcher, error) {
	watcher, err := fsnotify.NewWatcher()
	if err != nil {
		return nil, err
	}

	w := &Watcher{
		watcher:              watcher,
		watchedPathCount:     counter.StringCounter{},
		trackedToWatchedPath: map[string]string{},
		Events:               make(chan Event),
		Errors:               make(chan error),
		stop:                 make(chan struct{}),
	}

	// We add all paths in the constructor avoid the need for additional
	// synchronization, as the loop goroutine below will call updateWatchedPath
	// concurrently
	for _, f := range trackedFiles {
		err := w.updateWatchedPath(f)
		if err != nil {
			return nil, err
		}
	}

	go w.loop()

	return w, nil
}