在go-inotify中观看递归目录

I am using this go library https://godoc.org/golang.org/x/exp/inotify for file and folder watcher in Linux inotify when we use directly in Linux it gives one parameter to be passed to watch recursive directories i.e. --r but in this wrapper how do I specify while calling the function.

package main

import (
"golang.org/x/exp/inotify"
"log"
)

func main() {
  watcher, err := inotify.NewWatcher()
  if err != nil {
      log.Fatal(err)
  }
  err = watcher.Watch("/home/minions")
  if err != nil {
      log.Fatal(err)
  }
  for {
      select {
      case ev := <-watcher.Event:
          log.Println("event:", ev)
      case err := <-watcher.Error:
          log.Println("error:", err)
      }
  }
}

This is my go code.

You can't. INotify is not recursive, so you must list all the subdirectories (taking care to watch for the creation of new ones!) and add new watches as needed.

A competing library has an open ticket for recursive directory watching, but it isn't resolved as of 2016: https://github.com/howeyc/fsnotify/issues/56