1 回答

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
- 1 回答
- 0 關(guān)注
- 297 瀏覽
添加回答
舉報(bào)