code: func hasComponent(component, fullpath string) bool {
  	// trim Windows volume name
  	fullpath = strings.TrimPrefix(fullpath, filepath.VolumeName(fullpath))
  	for {
  		i := strings.Index(fullpath, component)
  		if i == -1 {
  			return false
  		}
  		if i != 0 && fullpath[i-1] == filepath.Separator {
  			componentEnd := i + len(component)
  			if componentEnd == len(fullpath) {
  				return true
  			}
  			if fullpath[componentEnd] == filepath.Separator {
  				return true
  			}
  		}
  		fullpath = fullpath[i+1:]
  	}
  	panic("unreachable")
  }
docs: // hasComponent returns whether the pathComponent is a path component of
  // fullpath. i.e it is a part of fullpath that fits exactly between two path
  // separators.