godoc

golang之log

天大地大妈咪最大 提交于 2020-04-26 16:07:19
标准库log golang实现了简单易用的log,可以满足基本需求。 虽然标准库实现了syslog,但已冻结不增加新功能。 Package log implements a simple logging package. It defines a type, Logger, with methods for formatting output. It also has a predefined 'standard' Logger accessible through helper functions Print[f|ln], Fatal[f|ln], and Panic[f|ln], which are easier to use than creating a Logger manually. That logger writes to standard error and prints the date and time of each logged message. Every log message is output on a separate line: if the message being printed does not end in a newline, the logger will add one. The Fatal functions call os

Excelize 发布 2.1.0 版本, Go 语言最受欢迎的 Excel 基础库

两盒软妹~` 提交于 2020-04-07 02:37:40
Excelize 是 Go 语言编写的用于操作 Office Excel 文档类库,基于 ECMA-376 Office Open XML 标准。可以使用它来读取、写入由 Microsoft Excel™ 2007 及以上版本创建的 XLSX 文档。相比较其他的开源类库,Excelize 支持写入原本带有图片(表)、透视表和切片器等复杂样式的文档,还支持向 Excel 文档中插入图片与图表,并且在保存后不会丢失文档原有样式,可以应用于各类报表系统中。入选 2018 开源中国码云 Gitee 最有价值开源项目 GVP ,目前已成为 Go 语言最受欢迎的 Excel 文档基础库。 开源代码 GitHub: github.com/xuri/excelize Gitee: gitee.com/xurime/excelize 中文文档: xuri.me/excelize/zh-hans Excelize 知名用户 2020年2月10日,社区正式发布了 2.1.0 版本,该版本包含了多项新增功能、错误修复和兼容性提升优化。下面是有关该版本更新内容的摘要,完整的更改列表可查看 changelog 。 有关更改的摘要,请参阅 Release Notes 。完整的更改列表可查看 change log 。 Release Notes 此版本中最显著的变化包括: 新增功能 新增

How to create document with godoc?

让人想犯罪 __ 提交于 2020-01-17 15:22:11
问题 I create simple go with comment in the application to the function and the package I tried godoc -html and my application and the result <!-- 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

Godoc documentation not outputting lists

冷暖自知 提交于 2020-01-11 07:00:11
问题 I have, throughout the project I'm responsible for testing and documenting, created documentation for the functions and methods, in the following format: // CheckPermissionArray checks that values is an array that contains the `expectedValue` // // Parameters: // // - `values` : the array to check // - `expectedValue` : the value to search for // // Returns: // // - an error iff `expectedValue` is not in `values` The boss and other programmers approve of this format, but the problem is that

How do you serve simple documentation for go programs using godoc as a webpage?

坚强是说给别人听的谎言 提交于 2019-12-20 17:29:50
问题 I was trying to serve a specific local go file as a documentation web page, but was not able to do it. The official godoc documentation says: With the -http flag (i.e. the godoc command), it runs as a web server and presents the documentation as a web page. user_me$ godoc -http=:6060 This does create something similar as the go page but it does not render the specific file that I want to render. So I tried to provide the name of the file I wanted: user_me$ godoc -http=:6000 hello.go However,

What steps are needed to document `package main` in Godoc?

巧了我就是萌 提交于 2019-12-20 09:57:35
问题 Godoc is a great tool for documenting packages, however it seems to be less useful when it's used against package main . I'll see an output that only displays the notes I've written to myself using //BUG and subdirectories. Godoc only displays exported functions and seems to have no way to display unexported / functions from main. I would find it useful to see a list of functions in main. Since this isn't supported, I tend to shove a list of functions at the top of the package description but

Godoc, create html for entire package

匆匆过客 提交于 2019-12-04 01:48:22
问题 How can I use godoc to create html documentation for an entire package. i.e. recursively. At the moment when I run: godoc -html -goroot="mypath" pkg > index.html I just get an index.html that contains information on the .go files in the current directory. There is no documentation for the other sub packages but the index.html does include dead links for them. How can I run the above command in a recursive fashion? Perhaps I am missing something because there is no mention of recursion in the

What steps are needed to document `package main` in Godoc?

有些话、适合烂在心里 提交于 2019-12-02 20:53:11
Godoc is a great tool for documenting packages, however it seems to be less useful when it's used against package main . I'll see an output that only displays the notes I've written to myself using //BUG and subdirectories. Godoc only displays exported functions and seems to have no way to display unexported / functions from main. I would find it useful to see a list of functions in main. Since this isn't supported, I tend to shove a list of functions at the top of the package description but this feels like a workaround. Since I have to manually update the list of functions, I often put as

Godoc documentation not outputting lists

无人久伴 提交于 2019-12-02 05:22:37
I have, throughout the project I'm responsible for testing and documenting, created documentation for the functions and methods, in the following format: // CheckPermissionArray checks that values is an array that contains the `expectedValue` // // Parameters: // // - `values` : the array to check // - `expectedValue` : the value to search for // // Returns: // // - an error iff `expectedValue` is not in `values` The boss and other programmers approve of this format, but the problem is that godoc doesn't recognize the list: Is there a way to get the list to be recognized? Visual Studio Code

VisualStudioCode下golang必备插件

孤人 提交于 2019-11-30 12:13:29
VisualStudioCode 下golang必备插件 在使用VisualStudioCode编写go程序的时候会发现首次保存文件提示安装扩展,但是肯定会安装失败. 点开右下角提示,细看有10几个扩展全部安装失败,我们可以自己装 gocode godef golint go-find-references go-outline go-symbols guru gorename goreturns gopkgs 下载 gopm get -g -v github.com/ramya-rao-a/go-outline gopm get -g -v github.com/acroca/go-symbols gopm get -g -v github.com/mdempsky/gocode gopm get -g -v github.com/rogpeppe/godef gopm get -g -v golang.org/x/tools/cmd/godoc gopm get -g -v github.com/zmb3/gogetdoc gopm get -g -v golang.org/x/lint/golint gopm get -g -v github.com/fatih/gomodifytags gopm get -g -v golang.org/x/tools/cmd