godoc的使用

如何在本地轻松查看go document?

如何解决godoc无法找到的问题:

GolangDoc: Could not find godoc, (hint: is godoc installed?)

本文将介绍如何使用godoc查看go语言文档。

安装godoc

go get -v  golang.org/x/tools/cmd/godoc

启动Go Documentation Server

godoc -http=:6060

在浏览器中,打开url
http://localhost:6060

go document就呈现出来。

在这里插入图片描述

很简单吧,你也可以试一下。

如果因为被墙了,可以尝试下从github下载后编译

参考

How to make “godoc” command work on my system?

原文地址:https://www.cnblogs.com/lanyangsh/p/13284218.html