-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathgo_doc.cli.txt
49 lines (40 loc) · 2.91 KB
/
go_doc.cli.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
┏━━━━━━━━━━━━┓
┃ GO_DOC ┃
┗━━━━━━━━━━━━┛
VERSION ==> #See Go language
RELATED DOCUMENTATION ==> #See Go language
┌─────────────────────┐
│ COMMENTS FORMAT │
└─────────────────────┘
PACKAGE COMMENT ==> #Comment above "package PACKAGE"
#Only on one file per PACKAGE
# - if big, convention is to have a doc.go file with only the package comment and "package PACKAGE"
#Should start with "Package PACKAGE ..." with a short description
#Longer description should go after an empty comment line
VARIABLE COMMENT ==> #Comment above variable declaration
#Should be on any exported variable
#Should start with "VAR ..."
BUG(AUTHOR): ... #Bug note, inside variable comment
TODO(AUTHOR): ... #Same for todo. Not shown by go doc, but shown by godoc -notes=TODO
Deprecated: ... #Convention for deprecated message
FOLDING ==> #Newlines in comments require an empty comment line. Otherwise folded to a space.
CAPITALIZING ==> #Should start with uppercase and end with period.
┌─────────┐
│ CLI │
└─────────┘
go doc IMPORT_PATHS|PACKAGE[.VARR]#Prints all|one exported variables of a PACKAGE
go doc IMPORT_PATHS|PACKAGE [VARR]#If no IMPORT_PATHS|PACKAGE: current one
go doc VARR #For each, it also prints:
# - type definition
# - any variable comment, providing -all CLI flag
#For whole PACKAGE, it also prints:
# - PACKAGE comment
# - PACKAGE name
# - MODULE_PATH
-all #Show all variables comments
#Also separates variables by type
-src #Print full source code. Only when VARR is used.
-u #Also show non-exported package-scope variables
-short #Only print type definitions
-cmd #Unless set, main PACKAGEs only shown when VARR is used
-c #Unless set, VARR is case-insensitive