Why does golint tell me "type Guid should be GUID"?

xuanbao · · 373 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I thought the convention is TitleCase for structs. Why does the linter do this for Guid, but not for Guids? I read that the language has no UUID/GUID type.</p> <p>// Guid is dotnet compatible Guid (MS uuid)</p> <p>type Guid struct {</p> <pre><code>ByteArray [16]byte </code></pre> <p>}</p> <p>Background: Its my first week messing with GO. I&#39;ve run through the tutorials and saw that the language lacks a GUID type (I&#39;m a c# programmer by trade), so I thought this would be a good learning project (yes I know there are UUID/GUID projects out there).</p> <hr/>**评论:**<br/><br/>dominikh: <pre><p><a href="https://github.com/golang/go/wiki/CodeReviewComments#initialisms" rel="nofollow">https://github.com/golang/go/wiki/CodeReviewComments#initialisms</a></p></pre>tabacco: <pre><p>The linter has a bunch of common acronyms it searches for, which is probably why it misses &#39;Guids&#39;</p></pre>

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

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