![goコマンド『doc』](https://mitikusa-engineer.com/wp-content/uploads/2022/07/Go-1024x538.png)
Go言語に組み込まれているコマンド『doc』についてまとめました。
動作環境
ホストOS | Windows 10 21H1(19043.2130) 64bit |
WSL | 2 |
Visual Studio Code | 1.70.2 |
Docker Desktop | 4.12.0(85629) |
Go | 1.19.2 |
構文
# Go言語のパッケージのドキュメントを出力する
# go doc [パッケージ名]
go doc fmt
==========
package fmt // import "fmt"
Package fmt implements formatted I/O with functions analogous to C's printf and
scanf. The format 'verbs' are derived from C's but are simpler.
# Printing
The verbs:
General:
%v the value in a default format
when printing structs, the plus flag (%+v) adds field names
%#v a Go-syntax representation of the value
%T a Go-syntax representation of the type of the value
%% a literal percent sign; consumes no value
・
・
・