mkdir.go

agolangf · · 504 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Because this was missing from the std lib:</p> <p><a href="https://github.com/mcandre/go-mkdir" rel="nofollow">https://github.com/mcandre/go-mkdir</a></p> <hr/>**评论:**<br/><br/>TheMerovius: <pre><p><a href="https://godoc.org/os#MkdirAll" rel="nofollow">It&#39;s not missing</a></p></pre>mcandre: <pre><p>Er, Go&#39;s Mkdir fails if the path already exists. We want <code>mkdir -p</code> behavior (<code>mkdir</code> in Windows).</p></pre>TheMerovius: <pre><blockquote> <p>Er, Go&#39;s Mkdir fails if the path already exists.</p> </blockquote> <p><a href="https://golang.org/src/os/path.go#L24" rel="nofollow">No, it doesn&#39;t.</a></p> <p>(humz, to be more precise: Mkdir might, but MkdirAll, which I linked to, doesn&#39;t)</p></pre>mcandre: <pre><p>Confirmed. Deprecating my mkdir.go with maximum force!</p></pre>justinisrael: <pre><p>That was quite alot of build time requirements listed for a project that provides a 3 line function. I don&#39;t think it is quite common in the Go community to create such small utility libraries. Especially one that provides a single 3 line wrapper function around mkdir </p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

504 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传