MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / processAllFiles

Method processAllFiles

cmd/gosqlx/cmd/watch.go:248–269  ·  view source on GitHub ↗

processAllFiles runs initial processing on all watched files

()

Source from the content-addressed store, hash-verified

246
247// processAllFiles runs initial processing on all watched files
248func (fw *FileWatcher) processAllFiles() error {
249 timestamp := time.Now().Format("15:04:05")
250
251 // Copy files under lock to avoid race conditions
252 fw.watchedMu.RLock()
253 files := make([]string, 0, len(fw.watchedFiles))
254 for file := range fw.watchedFiles {
255 files = append(files, file)
256 }
257 fw.watchedMu.RUnlock()
258
259 for _, file := range files {
260 switch fw.opts.Mode {
261 case WatchModeValidate:
262 fw.validateFile(file, timestamp)
263 case WatchModeFormat:
264 fw.formatFile(file, timestamp)
265 }
266 }
267
268 return nil
269}
270
271// addWatchPaths expands and adds file paths to the watcher
272func (fw *FileWatcher) addWatchPaths(args []string) error {

Callers 1

WatchMethod · 0.95

Calls 3

validateFileMethod · 0.95
formatFileMethod · 0.95
FormatMethod · 0.45

Tested by

no test coverage detected