code: func IsDirWriteable(dir string) error {
  	f := path.Join(dir, ".touch")
  	if err := ioutil.WriteFile(f, []byte(""), privateFileMode); err != nil {
  		return err
  	}
  	return os.Remove(f)
  }
docs: // IsDirWriteable checks if dir is writable by writing and removing a file
  // to dir. It returns nil if dir is writable.