-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathgo_generate.cli.txt
35 lines (29 loc) · 2 KB
/
go_generate.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
┏━━━━━━━━━━━━━━━━━┓
┃ GO_GENERATE ┃
┗━━━━━━━━━━━━━━━━━┛
VERSION ==> #See Go language
RELATED DOCUMENTATION ==> #See Go language
┌──────────────┐
│ GENERATE │
└──────────────┘
go generate IMPORT_PATHS #Execute any COMMAND from //go:generate comments
#Does not remove the comment
#Exit code is any COMMAND non-0 exit code, or 0
#Goal is to modify source file
#Implies -tags=generate
-run=REGEXP #Only run comments whose full content partially matches REGEXP
-ANY_GO_BUILD_FLAG #
//go:generate COMMAND [ARGS...] #COMMAND is not executed within a shell
#The following environment variables are added:
# - $GOARCH, $GOOS
# - $GOPACKAGE: PACKAGE
# - $GOFILE: filename
# - $GOLINE: line number
# - $DOLLAR "$"
#Before executing the COMMAND:
# - double quotes surrounding ARGs are removed
# - $ENVVAR are expanded
#By convention, often at top of file
//go:generate -command ALIAS
COMMAND [ARGS...] #Means if another //go:generate uses ALIAS as COMMAND, it will be expanded to COMMAND [ARGS...]
// Code generated ... DO NOT EDIT.#By convention, this comment should be before any modifications done by go generate