code: func parseMountinfo(mountinfo io.Reader, dir string) (isMounted bool, readOnly bool, err error) {
  	sc := bufio.NewScanner(mountinfo)
  	for sc.Scan() {
  		var (
  			mountID      int
  			parentID     int
  			majorMinor   string
  			root         string
  			mountPoint   string
  			mountOptions string
  		)
  
  		_, err := fmt.Sscanf(sc.Text(), "%d %d %s %s %s %s",
  			&mountID, &parentID, &majorMinor, &root, &mountPoint, &mountOptions)
  		if err != nil {
  			return false, false, err
  		}
  
  		if mountPoint == dir {
  			isMounted = true
  			optionsParts := strings.Split(mountOptions, ",")
  			for _, o := range optionsParts {
  				switch o {
  				case "ro":
  					readOnly = true
  				case "rw":
  					readOnly = false
  				}
  			}
  		}
  	}
  
  	return
  }
docs: // parseMountinfo parses a Reader representing a /proc/PID/mountinfo file and
  // returns whether dir is mounted and if so, whether it is read-only or not