Quotes in godoc

blov · · 775 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I was looking at the source of the <code>testing</code> package and found </p> <pre><code>``go help test&#39;&#39; </code></pre> <p>is shown in the godoc as &#34;go help test&#34; with proper quotes. I didn&#39;t find this behavior documented anywhere. Am I missing something obvious or should I file a bug to mention this feature somewhere?</p> <p>Refer:</p> <p><a href="https://github.com/golang/go/blob/master/src/testing/testing.go#L17-18">https://github.com/golang/go/blob/master/src/testing/testing.go#L17-18</a></p> <p><a href="http://golang.org/pkg/testing/#pkg-overview">http://golang.org/pkg/testing/#pkg-overview</a></p> <hr/>**评论:**<br/><br/>: <pre><p>[deleted]</p></pre>Ainar-G: <pre><p>False. It&#39;s documented exactly where you linked to:</p> <blockquote> <p>Each span of unindented non-blank lines is converted into a single paragraph. <em>There is one exception to the rule: a span that consists of a single line, is followed by another paragraph span, begins with a capital letter, and contains no punctuation is formatted as a heading.</em></p> </blockquote> <p>(Emphasis added.)</p></pre>ninja_uzumaki: <pre><p>Yeah, lots of minutiae are undocumented. Hope someone, may be <a href="/u/natefinch" rel="nofollow">/u/natefinch</a> (<a href="https://github.com/natefinch/godocgo" rel="nofollow">https://github.com/natefinch/godocgo</a>) can edit the documentation to specify them. </p></pre>natefinch: <pre><p>Yeah, I wish the documentation on godoc were better specified. There&#39;s a lot of things it does that you can really only figure out by using it and reading a lot of other people&#39;s documentation... like which docs get formatting and which don&#39;t... there&#39;s even plenty of stuff I missed in godocgo... like functions that return a type getting sorted under that type in the docs.</p></pre>Ainar-G: <pre><p>Good find! I haven&#39;t found any mention of this either. This might mean it&#39;s worth opening an issue.</p></pre>dominikh: <pre><p>`` and &#39;&#39; translate to u201c and u201d respectively. They&#39;re not ordinary quotes. I can&#39;t tell you where it&#39;s documented, but it&#39;s a feature, not a bug.</p></pre>ninja_uzumaki: <pre><p>I meant should I file a bug to document this feature somewhere?</p></pre>

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

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