code: func packToWriter(srcPath string, w io.Writer, fn func(fullName string, fi os.FileInfo) error, includeDir bool) error {
  	zw := zip.NewWriter(w)
  	defer zw.Close()
  
  	f, err := os.Open(srcPath)
  	if err != nil {
  		return err
  	}
  	defer f.Close()
  
  	fi, err := f.Stat()
  	if err != nil {
  		return err
  	}
  
  	basePath := path.Base(srcPath)
  	if fi.IsDir() {
  		if includeDir {
  			if err = packFile(srcPath, basePath, zw, fi); err != nil {
  				return err
  			}
  		} else {
  			basePath = ""
  		}
  		return packDir(srcPath, basePath, zw, fn)
  	}
  	return packFile(srcPath, basePath, zw, fi)
  }
docs: // packToWriter packs given path object to io.Writer.