为了账号安全,请及时绑定邮箱和手机立即绑定

如何使用 godoc 创建文档?

如何使用 godoc 创建文档?

Go
慕桂英546537 2023-05-08 14:59:12
我创建了简单的 go with comment in the application to the function and the package 我尝试了 godoc -html 和我的应用程序以及结果<!--    Copyright 2009 The Go Authors. All rights reserved.    Use of this source code is governed by a BSD-style    license that can be found in the LICENSE file.--><!--        Note: Static (i.e., not template-generated) href and id        attributes start with "pkg-" to make it impossible for        them to conflict with generated attributes (some of which        correspond to Go identifiers).-->        <script type='text/javascript'>        document.ANALYSIS_DATA = ;        document.CALLGRAPH = ;        </script>                <p>Package main provides logic ...</p>为什么我没有看到我的其他文件?以及为什么<p>包中有空格// Package main provides logic.package mainimport (}some types.....func main() {}// doLogic .....// .....// ....func (sm *myI) doLogic (s *myStruct) bool {}
查看完整描述

1 回答

?
Smart猫小萌

TA贡献1911条经验 获得超7个赞

默认情况下不记录未导出的标识符。至少设置?m=all以查看它们:


godoc 服务的网页的呈现方式可以通过“m”URL 参数来控制;它接受以逗号分隔的标志名称列表作为值:


all     show documentation for all declarations, not just the exported ones

methods show all embedded methods, not just those of unexported anonymous fields

src     show the original source code rather then the extracted documentation

查看完整回答
反对 回复 2023-05-08
  • 1 回答
  • 0 关注
  • 102 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号