<p>Hello!
I've been learning Go for the past few weeks now, and finally released my very first project. It'd be awesome to get a code review! </p>
<p>Here is my project <a href="https://github.com/mikaa123/imapmq" rel="nofollow">https://github.com/mikaa123/imapmq</a></p>
<p>Thanks!</p>
<hr/>**评论:**<br/><br/>Ainar-G: <pre><blockquote>
<p>Pwd</p>
</blockquote>
<p>"Pwd" usually means "Print Working Directory". I'd go with "Pass" or "Password", but that's nitpicking.</p>
<blockquote>
<p>Logout()</p>
</blockquote>
<p>Usually such methods called close, but I don't know the specifics of IMAPMQ, so I might be wrong.</p>
<p><a href="https://github.com/mikaa123/imapmq/blob/master/worker.go#L77" rel="nofollow">https://github.com/mikaa123/imapmq/blob/master/worker.go#L77</a></p>
<p>Error ignored. Why?</p>
<p><a href="https://github.com/mikaa123/imapmq/blob/master/imapmq.go#L28" rel="nofollow">https://github.com/mikaa123/imapmq/blob/master/imapmq.go#L28</a></p>
<p>If all <code>done</code> ever does is being closed, why not make it <code>chan struct{}</code>?</p></pre>misokol123: <pre><p>Thanks for your input!</p>
<blockquote>
<p>"Pwd" usually means "Print Working Directory". I'd go with "Pass" or "Password", but that's nitpicking.</p>
</blockquote>
<p>You're totally right, didn't think about that.</p>
<blockquote>
<p>Usually such methods called close, but I don't know the specifics of IMAPMQ, so I might be wrong.</p>
</blockquote>
<p>Makes sense, in this case it logs out of the IMAP session, but I guess that's an implementation detail. Close would probably be more explicit.</p>
<blockquote>
<p>Error ignored. Why?</p>
</blockquote>
<p>In this case it's ignored because no error can happen at that place. If it does, then it's a bug in my code and I'd rather have it break loudly. I guess I could catch the error and Panic if it happens, but since I control the input, I'm confident that it will never be called.</p></pre>FIuffyRabbit: <pre><p>Or passwd. Some security audits will complain at the usage of <em>password</em>. </p></pre>misokol123: <pre><p>Good to know. I ended-up using that.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传