how visibility is determined if non Latin words were used?

agolangf · · 541 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>if i could use UTF-8 in variable names, so how i could export a variable?</p> <hr/>**评论:**<br/><br/>Bake_Jailey: <pre><p><a href="https://golang.org/ref/spec#Exported_identifiers" rel="nofollow">https://golang.org/ref/spec#Exported_identifiers</a></p> <p>The spec isn&#39;t that hard to read. You&#39;ll get a lot out of it.</p></pre>mrwnmonm: <pre><p>i&#39;m not used to read the spec, i rely on &#34;effective go&#34; document<br/> and actually what i was talking about is not mentioned in the spec nor the effective go</p></pre>Redundancy_: <pre><p>I&#39;m not sure I understand:</p> <blockquote> <p>the first character of the identifier&#39;s name is a Unicode upper case letter (Unicode class &#34;Lu&#34;);</p> </blockquote> <p>(from the spec) That set of characters - <a href="http://www.fileformat.info/info/unicode/category/Lu/list.htm" rel="nofollow">http://www.fileformat.info/info/unicode/category/Lu/list.htm</a></p></pre>mrwnmonm: <pre><p>i think i was confused, sorry<br/> i thought there is a best practice for other languages that is not mentioned</p></pre>throwbible: <pre><p>Kinda sucks for languages that uses unicameral casing, like Georgian. They won&#39;t be able to export identifiers.</p></pre>weberc2: <pre><p>They&#39;ll just have to prefix them with unicode upper case letters.</p></pre>TheMerovius: <pre><p>The usual recommendation is to not export identifiers outside of ASCII, because people won&#39;t be able to type them anyway, i.e. you just make the usage of your package harder.</p> <p>If they do feel the need, people usually prefix their public identifier with an X when using a written language without capital letters. It&#39;s not elegant, but it works.</p></pre>mrwnmonm: <pre><p>thanks</p></pre>

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

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