{"id":10007046,"date":"2023-01-06T20:03:18","date_gmt":"2023-01-06T12:03:18","guid":{"rendered":"https:\/\/ityet.com\/?p=10007046"},"modified":"2023-01-06T20:03:18","modified_gmt":"2023-01-06T12:03:18","slug":"go1-18-%e5%ae%89%e8%a3%85godoc%e6%8a%a5%e9%94%99","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10007046","title":{"rendered":"go1.18 \u5b89\u88c5godoc\u62a5\u9519"},"content":{"rendered":"<p>\u6700\u8fd1\u5728\u8bd5\u7740\u5199go\u5e93\uff0c\u60f3\u770b\u770bgodoc\u6548\u679c\uff0c\u7136\u540e\u53d1\u73b0\u547d\u4ee4\u65e0\u6cd5\u627e\u5230<\/p>\n<p>\u67e5\u4e86\u4e0b\u7f51\u4e0a\u62f7\u8d1d\u6765\u62f7\u8d1d\u53bb\u7684\u8d44\u6599\uff0c\u53d1\u73b0go 1.1.13\u7248\u672c\u4e4b\u540e\u5c31\u4ece\u6838\u5fc3\u5305\u4e2d\u79fb\u9664\u4e86\u9700\u8981\u81ea\u5df1\u5b89\u88c5<\/p>\n<p>\u7136\u540e\u5c1d\u8bd5go get\u5b89\u88c5\uff0c<code>go get golang.org\/x\/tools\/cmd\/godoc<\/code><\/p>\n<p>\u53d1\u73b0\u62a5\u9519\u5982\u4e0b<\/p>\n<pre><code>go: go.mod file not found in current directory or any parent directory.\n    'go get' is no longer supported outside a module.\n    To build and install a command, use 'go install' with a version,\n    like 'go install example.com\/cmd@latest'\n    For more information, see https:\/\/golang.org\/doc\/go-get-install-deprecation\n    or run 'go help get' or 'go help install'.<\/code><\/pre>\n<p>\u641c\u7d22\u65e0\u679c\uff0c\u4ed4\u7ec6\u8bfb\u4e86\u4e0b\u62a5\u9519\u4fe1\u606f\uff0c\u53d1\u73b0\u65b0\u7248\u672c\u53d6\u6d88\u4e86go get\u5b89\u88c5\u5916\u90e8\u6a21\u5757\uff0c\u7528go get\u547d\u4ee4\u5fc5\u987b\u6709go mod\uff0c\u5c31\u7b97\u5f00\u542f\u4e86<code>go env -w GO111MODULE=on<\/code>\u4e5f\u4e0d\u884c<\/p>\n<p>\u6240\u4ee5\u65b0\u7248\u5b89\u88c5godoc\u7684\u6b63\u786e\u547d\u4ee4\u662f<\/p>\n<pre><code>go install golang.org\/x\/tools\/cmd\/godoc@latest<\/code><\/pre>\n<p>\u6ce8\u610f\uff0c\u5fc5\u987b\u5728\u6700\u540e\u6307\u5b9a\u7248\u672c<\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000043262555\">https:\/\/segmentfault.com\/a\/1190000043262555<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u5728\u8bd5\u7740\u5199go\u5e93\uff0c\u60f3\u770b\u770bgodoc\u6548\u679c\uff0c\u7136\u540e\u53d1\u73b0\u547d\u4ee4\u65e0\u6cd5\u627e\u5230 \u67e5\u4e86\u4e0b\u7f51\u4e0a\u62f7\u8d1d\u6765\u62f7\u8d1d\u53bb\u7684\u8d44\u6599\uff0c\u53d1\u73b0go 1.1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10007046","post","type-post","status-publish","format-standard","hentry","category-share"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10007046","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10007046"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10007046\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10007046"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10007046"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10007046"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}