第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

go/ast 包中的 Doc 和 Comment 有什么區(qū)別?

go/ast 包中的 Doc 和 Comment 有什么區(qū)別?

Go
富國(guó)滬深 2021-10-04 16:15:29
我正在使用go/astandgo/parser包來(lái)做某事,但我對(duì)Doc和之間的區(qū)別感到困惑Comment。是第一行注釋a Doc,然后其他人為Comment?這是一個(gè)示例:TypeSpec struct {    Doc     *CommentGroup // associated documentation; or nil    Name    *Ident        // type name    Type    Expr          // *Ident, *ParenExpr, *SelectorExpr, *StarExpr, or any of the *XxxTypes    Comment *CommentGroup // line comments; or nil}
查看完整描述

1 回答

?
慕的地6264312

TA貢獻(xiàn)1817條經(jīng)驗(yàn) 獲得超6個(gè)贊

來(lái)自src/go/ast/ast.go#L70-L75:


// A CommentGroup represents a sequence of comments

// with no other tokens and no empty lines between.

遵循Godoc:記錄 Go 代碼:


Doc是注釋一個(gè)或幾個(gè)連續(xù)的線(// ...)之前的TypeSpec

在其聲明之前直接寫(xiě)一個(gè)常規(guī)注釋?zhuān)虚g沒(méi)有空行


// A TypeSpec node represents a type declaration (TypeSpec production).

^^^^^^^^^^^^...

TypeSpec struct {

Comment是與字段本身相關(guān)的注釋?zhuān)瑥耐恍虚_(kāi)始,但可以分布在多個(gè)連續(xù)行上(因此為“ CommentGroup”)


Name    *Ident        // type name

                      ^^^^^^^^^^^

                      // the comment associated to Name

                      // could go on over several lines


查看完整回答
反對(duì) 回復(fù) 2021-10-04
  • 1 回答
  • 0 關(guān)注
  • 297 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)