My personal dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_go 26KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. #compdef go
  2. # ------------------------------------------------------------------------------
  3. # Copyright (c) 2016 Github zsh-users - http://github.com/zsh-users
  4. # Copyright (c) 2013-2015 Robby Russell and contributors (see
  5. # https://github.com/robbyrussell/oh-my-zsh/contributors)
  6. # Copyright (c) 2010-2014 Go authors
  7. #
  8. # Redistribution and use in source and binary forms, with or without
  9. # modification, are permitted provided that the following conditions are met:
  10. # * Redistributions of source code must retain the above copyright
  11. # notice, this list of conditions and the following disclaimer.
  12. # * Redistributions in binary form must reproduce the above copyright
  13. # notice, this list of conditions and the following disclaimer in the
  14. # documentation and/or other materials provided with the distribution.
  15. # * Neither the name of the zsh-users nor the
  16. # names of its contributors may be used to endorse or promote products
  17. # derived from this software without specific prior written permission.
  18. #
  19. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  20. # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  21. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  22. # ARE DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY DIRECT,
  23. # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  24. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  25. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  26. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  28. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. # ------------------------------------------------------------------------------
  30. # Description
  31. # -----------
  32. #
  33. # Completion script for go 1.5 (http://golang.org).
  34. #
  35. # ------------------------------------------------------------------------------
  36. # Authors
  37. # -------
  38. #
  39. # * Mikkel Oscar Lyderik <mikkeloscar@gmail.com>
  40. # * oh-my-zsh authors:
  41. # https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/golang/golang.plugin.zsh
  42. # * Go authors
  43. #
  44. # ------------------------------------------------------------------------------
  45. typeset -A opt_args
  46. _go() {
  47. local -a commands build_flags
  48. commands=(
  49. 'build:compile packages and dependencies'
  50. 'clean:remove object files'
  51. 'doc:show documentation for package or symbol'
  52. 'env:print Go environment information'
  53. 'fix:run go tool fix on packages'
  54. 'fmt:run gofmt on package sources'
  55. 'generate:generate Go files by processing source'
  56. 'get:download and install packages and dependencies'
  57. 'install:compile and install packages and dependencies'
  58. 'list:list packages'
  59. 'run:compile and run Go program'
  60. 'test:test packages'
  61. 'tool:run specified go tool'
  62. 'version:print Go version'
  63. 'vet:run go tool vet on packages'
  64. 'help:get more information about a command'
  65. )
  66. _arguments \
  67. "1: :{_describe 'command' commands}" \
  68. '*:: :->args'
  69. case $state in
  70. args)
  71. build_flags=(
  72. '-a[force rebuilding of packages that are already up-to-date]'
  73. '-n[print the commands but do not run them]'
  74. '-p[number of builds that can be run in parallel]:number'
  75. '-race[enable data race detection]'
  76. '-v[print the names of packages as they are compiled]'
  77. '-work[print temporary work directory and keep it]'
  78. '-x[print the commands]'
  79. '-asmflags[arguments for each go tool asm invocation]:flags'
  80. '-buildmode[build mode to use]:mode'
  81. '-compiler[name of compiler to use]:name'
  82. '-gccgoflags[arguments for gccgo]:args'
  83. '-gcflags[arguments for each go tool compile invocation]:args'
  84. '-installsuffix[suffix to add to package directory]:suffix'
  85. '-ldflags[arguments to pass on each go tool link invocation.]:flags'
  86. '-linkshared[link against shared libraries]'
  87. '-pkgdir[install and load all packages from dir]:dir'
  88. '-tags[list of build tags to consider satisfied]:tags'
  89. '-toolexec[program to use to invoke toolchain programs]:args'
  90. )
  91. __go_packages() {
  92. local gopaths
  93. declare -a gopaths
  94. gopaths=("${(s/:/)$(go env GOPATH)}")
  95. gopaths+=("$(go env GOROOT)")
  96. for p in $gopaths; do
  97. _path_files -W "$p/src" -/
  98. done
  99. }
  100. case $words[1] in
  101. build)
  102. _arguments \
  103. '-o[force build to write to named output file]:file:_files' \
  104. '-i[installs the packages that are dependencies of the target]' \
  105. ${build_flags[@]} \
  106. '*:importpaths:__go_packages'
  107. ;;
  108. clean)
  109. _arguments \
  110. '-i[remove corresponding installed archive or binary]' \
  111. '-r[apply clean recursively on all dependencies]' \
  112. ${build_flags[@]} \
  113. '*:importpaths:__go_packages'
  114. ;;
  115. doc)
  116. _arguments \
  117. '-c[respect case when matching symbols]' \
  118. '-cmd[treat a command (package main) like a regular package]' \
  119. '-u[show docs for unexported and exported symbols and methods]'
  120. ;;
  121. fix)
  122. _arguments '*:importpaths:__go_packages'
  123. ;;
  124. fmt)
  125. _arguments \
  126. '-n[prints commands that would be executed]' \
  127. '-x[prints commands as they are executed]' \
  128. '*:importpaths:__go_packages'
  129. ;;
  130. generate)
  131. _arguments \
  132. '-run=[specifies a regular expression to select directives]:regex' \
  133. '-x[print the commands]' \
  134. '-n[print the commands but do not run them]' \
  135. '-v[print the names of packages as they are compiled]' \
  136. "*:args:{ _alternative ':importpaths:__go_packages' _files }"
  137. ;;
  138. get)
  139. _arguments \
  140. '-d[instructs get to stop after downloading the packages]' \
  141. '-f[force get -u not to verify that each package has been checked from vcs]' \
  142. '-fix[run the fix tool on the downloaded packages]' \
  143. '-insecure[permit fetching/resolving custom domains]' \
  144. '-t[also download the packages required to build tests]' \
  145. '-u[use the network to update the named packages]' \
  146. ${build_flags[@]} \
  147. '*:importpaths:__go_packages'
  148. ;;
  149. install)
  150. _arguments ${build_flags[@]} \
  151. '*:importpaths:__go_packages'
  152. ;;
  153. list)
  154. _arguments \
  155. '-e[changes the handling of erroneous packages]' \
  156. '-f[specifies an alternate format for the list]:format' \
  157. '-json[causes package data to be printed in JSON format]' \
  158. ${build_flags[@]} \
  159. '*:importpaths:__go_packages'
  160. ;;
  161. run)
  162. _arguments \
  163. ${build_flags[@]} \
  164. '-exec[invoke the binary using xprog]:xporg' \
  165. '*:file:_path_files -g "*.go"'
  166. ;;
  167. test)
  168. _arguments \
  169. "-c[compile but don't run test]" \
  170. '-i[install dependencies of the test]' \
  171. '-bench[run benchmarks matching the regular expression]:regexp' \
  172. '-benchmem[print memory allocation statistics for benchmarks]' \
  173. '-benchtime[run benchmarks for t rime]:t' \
  174. '-blockprofile[write a goroutine blocking profile to the specified file]:block' \
  175. '-blockprofilerate[control goroutine blocking profiles]:n' \
  176. '-count[run each test and benchmark n times]:n' \
  177. '-cover[enable coverage analysis]' \
  178. '-covermode[set the mode for coverage analysis]:mode:(set count atomic)' \
  179. '-coverpkg[apply coverage analysis in each test of listed packages]:list' \
  180. '-coverprofile[write a coverage profile to file]:cover' \
  181. '-cpu[specify a list of GOMAXPROCS values]:cpus' \
  182. '-cpuprofile[write a CPU profile to the specified file]:profile' \
  183. '-memprofile[write a memory profile to file]:mem' \
  184. '-memprofilerate[enable more precise memory profiles]:n' \
  185. '-outputdir[place output files from profiling in output dir]:dir' \
  186. '-parallel[allow parallel execution of test functions]:n' \
  187. '-run[run tests and examples matching the regular expression]:regexp' \
  188. '-short[tell long-running tests to shorten their run time]' \
  189. '-timeout[timeout long running tests]:t' \
  190. '-trace[write an execution trace to the specified file]:trace' \
  191. '-v[verbose output]' \
  192. ${build_flags[@]} \
  193. '-exec[run test binary using xprog]:xprog' \
  194. '-o[compile test binary to named file]:file:_files' \
  195. '*:importpaths:__go_packages'
  196. ;;
  197. tool)
  198. local -a tools
  199. tools=($(go tool))
  200. _arguments \
  201. '-n[print command that would be executed]' \
  202. "1: :{_describe 'tool' tools}" \
  203. '*:: :->args'
  204. case $state in
  205. args)
  206. case $words[1] in
  207. addr2line)
  208. _files
  209. ;;
  210. asm)
  211. _arguments \
  212. '-D[predefined symbol with optional simple value]:value' \
  213. '-I[include directory]:value' \
  214. '-S[print assembly and machine code]' \
  215. '-debug[dump instructions as they are parsed]' \
  216. '-dynlink[support references to Go symbols]' \
  217. '-o[output file]:string' \
  218. '-shared[generate code that can be linked into a shared lib]' \
  219. '-trimpath[remove prefix from recorded source file paths]:string'
  220. ;;
  221. callgraph)
  222. local -a algos graphs
  223. algos=(
  224. 'static:static calls only'
  225. 'cha:Class Hierarchy Analysis'
  226. 'rta:Rapid Type Analysis'
  227. 'pta:inclusion-based Points-To Analysis'
  228. )
  229. graphs=(
  230. 'digraph:output in digraph format'
  231. 'graphviz:output in AT&T GraphViz (.dot) format'
  232. )
  233. _arguments \
  234. '-algo=[call-graph construction algorithm]:algos:{ _describe "algos" algos }' \
  235. "-test[include the package's tests in the analysis]" \
  236. '-format=[format in which each call graph edge is displayed]:graphs:{ _describe "graphs" graphs }'
  237. ;;
  238. cgo)
  239. _arguments \
  240. '-debug-define[print relevant #defines]' \
  241. '-debug-gcc[print gcc invocations]' \
  242. '-dynimport[if non-empty, print dynamic import data]:string' \
  243. '-dynlinker[record dynamic linker information]' \
  244. '-dynout[write -dynimport output to file]:file' \
  245. '-dynpackage[set Go package for -dynimport output]:string' \
  246. '-exportheader[where to write export header]:string' \
  247. '-gccgo[generate files for use with gccgo]' \
  248. '-gccgopkgpath[-fgo-pkgpath option used with gccgo]:string' \
  249. '-gccgoprefix[-fgo-prefix option used with gccgo]:string' \
  250. '-godefs[write Go definitions for C file to stdout]' \
  251. '-import_runtime_cgo[import runtime/cgo in generated code]' \
  252. '-import_syscall[import syscall in generated code]' \
  253. '-importpath[import path of package being built]:path' \
  254. '-objdir[object directory]:dir'
  255. ;;
  256. compile)
  257. _arguments \
  258. '-%[debug non-static initializers]' \
  259. '-+[compiling runtime]' \
  260. "-A[for bootstrapping, allow 'any' type]" \
  261. '-B[disable bounds checking]' \
  262. '-D[set relative path for local imports]:path' \
  263. '-E[debug symbol export]' \
  264. '-I[add directory to import search path]:directory' \
  265. '-K[debug missing line numbers]' \
  266. '-L[use full (long) path in error messages]' \
  267. '-M[debug move generation]' \
  268. '-N[disable optimizations]' \
  269. '-P[debug peephole optimizer]' \
  270. '-R[debug register optimizer]' \
  271. '-S[print assembly listing]' \
  272. '-V[print compiler version]' \
  273. '-W[debug parse tree after type checking]' \
  274. '-asmhdr[write assembly header to file]:file' \
  275. '-buildid[record id as the build id in the export metadata]:id' \
  276. '-complete[compiling complete package (no C or assembly)]' \
  277. '-cpuprofile[write cpu profile to file]:file' \
  278. '-d[print debug information about items in list]:list' \
  279. '-dynlink[support references to Go symbols]' \
  280. '-e[no limit on number of errors reported]' \
  281. '-f[debug stack frames]' \
  282. '-g[debug code generation]' \
  283. '-h[halt on error]' \
  284. '-i[debug line number stack]' \
  285. '-importmap[add definition of the form source=actual to import map]:definition' \
  286. '-installsuffix[set pkg directory suffix]:suffix' \
  287. '-j[debug runtime-initialized variables]' \
  288. '-l[disable inlining]' \
  289. '-largemodel[generate code that assumes a large memory model]' \
  290. '-live[debug liveness analysis]' \
  291. '-m[print optimization decisions]' \
  292. '-memprofile[write memory profile to file]:file' \
  293. '-memprofilerate[set runtime.MemProfileRate to rate]:rate' \
  294. '-nolocalimports[reject local (relative) imports]' \
  295. '-o[write output to file]:file' \
  296. '-p[set expected package import path]:path' \
  297. '-pack[write package file instead of object file]' \
  298. '-r[debug generated wrappers]' \
  299. '-race[enable race detector]' \
  300. '-s[warn about composite literals that can be simplified]' \
  301. '-shared[generate code that can be linked into a shared library]' \
  302. '-trimpath[remove prefix from recorded source file paths]:prefix' \
  303. '-u[reject unsafe code]' \
  304. '-v[increase debug verbosity]' \
  305. '-w[debug type checking]' \
  306. '-wb[enable write barrier (default 1)]' \
  307. '-x[debug lexer]' \
  308. '-y[debug declarations in canned imports (with -d)]' \
  309. '*:file:_path_files -g "*.go"'
  310. ;;
  311. cover)
  312. if (( CURRENT == 2 )); then
  313. _arguments \
  314. '-func=[output coverage profile information for each function]:string' \
  315. '-html=[generate HTML representation of coverage profile]:file:_files' \
  316. '-mode=[coverage mode]:mode:(set count atomic)'
  317. return
  318. fi
  319. _arguments \
  320. '-o[file for output]:file' \
  321. '-var=[name of coverage variable to generate]:var' \
  322. '*:file:_path_files -g "*.go"'
  323. ;;
  324. doc)
  325. _arguments \
  326. '-c[respect case when matching symbols]' \
  327. '-cmd[treat a command (package main) like a regular package]' \
  328. '-u[show docs for unexported and exported symbols and methods]' \
  329. ;;
  330. fix)
  331. _arguments \
  332. '-diff[display diffs instead of rewriting files]' \
  333. '-force[force fixes to run even if the code looks updated]:string' \
  334. '-r[restrict the rewrites]:string' \
  335. '*:files:_files'
  336. ;;
  337. link)
  338. _arguments \
  339. '-B[add an ELF NT_GNU_BUILD_ID note when using ELF]:note' \
  340. '-C[check Go calls to C code]' \
  341. '-D[set data segment address (default -1)]:address' \
  342. '-E[set entry symbol name]:entry' \
  343. '-H[set header type]:type' \
  344. '-I[use linker as ELF dynamic linker]:linker' \
  345. '-L[add specified directory to library path]:directory' \
  346. '-R[set address rounding quantum (default -1)]:quantum' \
  347. '-T[set text segment address (default -1)]:address' \
  348. '-V[print version and exit]' \
  349. '-W[disassemble input]' \
  350. '-X[add string value definition]:definition' \
  351. '-a[disassemble output]' \
  352. '-buildid[record id as Go toolchain build id]:id' \
  353. '-buildmode[set build mode]:mode' \
  354. '-c[dump call graph]' \
  355. '-cpuprofile[write cpu profile to file]:file' \
  356. '-d[disable dynamic executable]' \
  357. '-extld[use linker when linking in external mode]:linker' \
  358. '-extldflags[pass flags to external linker]:flags' \
  359. '-f[ignore version mismatch]' \
  360. '-g[disable go package data checks]' \
  361. '-h[halt on error]' \
  362. '-installsuffix[set package directory suffix]:suffix' \
  363. '-k[set field tracking symbol]:symbol' \
  364. '-linkmode[set link mode]:mode:(internal external auto)' \
  365. '-linkshared[link against installed Go shared libraries]' \
  366. '-memprofile[write memory profile to file]:file' \
  367. '-memprofilerate[set runtime.MemProfileRate to rate]:rate' \
  368. '-n[dump symbol table]' \
  369. '-o[write output to file]:file' \
  370. '-r[set the ELF dynamic linker search path to dir1:dir2:...]:path' \
  371. '-race[enable race detector]' \
  372. '-s[disable symbol table]' \
  373. '-shared[generate shared object (implies -linkmode external)]' \
  374. '-tmpdir[use directory for temporary files]:directory' \
  375. '-u[reject unsafe packages]' \
  376. '-v[print link trace]' \
  377. '-w[disable DWARF generation]' \
  378. '*:files:_files'
  379. ;;
  380. objdump)
  381. _arguments \
  382. '-s[only dump symbols matching this regexp]:regexp' \
  383. '*:files:_files'
  384. ;;
  385. pack)
  386. _arguments '1:ops:(c p r t x)' '::verbose:(v)' ':files:_files'
  387. ;;
  388. pprof)
  389. _arguments \
  390. '-callgrind[outputs a graph in callgrind format]' \
  391. '-disasm=[output annotated assembly]:p' \
  392. '-dot[outputs a graph in DOT format]' \
  393. '-eog[visualize graph through eog]' \
  394. '-evince[visualize graph through evince]' \
  395. '-gif[outputs a graph image in GIF format]' \
  396. '-gv[visualize graph through gv]' \
  397. '-list=[output annotated source for functions matching regexp]:p' \
  398. '-pdf[outputs a graph in PDF format]' \
  399. '-peek=[output callers/callees of functions matching regexp]:p' \
  400. '-png[outputs a graph image in PNG format]' \
  401. '-proto[outputs the profile in compressed protobuf format]' \
  402. '-ps[outputs a graph in PS format]' \
  403. '-raw[outputs a text representation of the raw profile]' \
  404. '-svg[outputs a graph in SVG format]' \
  405. '-tags[outputs all tags in the profile]' \
  406. '-text[outputs top entries in text form]' \
  407. '-top[outputs top entries in text form]' \
  408. '-tree[outputs a text rendering of call graph]' \
  409. '-web[visualize graph through web browser]' \
  410. '-weblist=[output annotated source in HTML]:p' \
  411. '-output=[generate output on file f (stdout by default)]:f' \
  412. '-functions[report at function level (default)]' \
  413. '-files[report at source file level]' \
  414. '-lines[report at source line level]' \
  415. '-addresses[report at address level]' \
  416. '-base[show delta from this profile]:profile' \
  417. '-drop_negative[ignore negative differences]' \
  418. '-cum[sort by cumulative data]' \
  419. '-seconds=[length of time for dynamic profiles]:n' \
  420. '-nodecount=[max number of nodes to show]:n' \
  421. '-nodefraction=[hide nodes below <f>*total]:f' \
  422. '-edgefraction=[hide edges below <f>*total]:f' \
  423. '-sample_index[index of sample value to display]' \
  424. '-mean[average sample value over first value]' \
  425. '-inuse_space[display in-use memory size]' \
  426. '-inuse_objects[display in-use object counts]' \
  427. '-alloc_space[display allocated memory size]' \
  428. '-alloc_objects[display allocated object counts]' \
  429. '-total_delay[display total delay at each region]' \
  430. '-contentions[display number of delays at each region]' \
  431. '-mean_delay[display mean delay at each region]' \
  432. '-runtime[show runtime call frames in memory profiles]' \
  433. '-focus=[restricts to paths going through a node matching regexp]:r' \
  434. '-ignore=[skips paths going through any nodes matching regexp]:r' \
  435. '-tagfocus=[restrict to samples tagged with key:value matching regexp]:r' \
  436. '-tagignore=[discard samples tagged with key:value matching regexp]' \
  437. '-call_tree[generate a context-sensitive call tree]' \
  438. '-unit=[convert all samples to unit u for display]:u' \
  439. '-divide_by=[scale all samples by dividing them by f]:f' \
  440. '-buildid=[override build id for main binary in profile]:id' \
  441. '-tools=[search path for object-level tools]:path' \
  442. '-help[help message]' \
  443. '*:files:_files'
  444. ;;
  445. trace)
  446. _arguments \
  447. '-http=[HTTP service address]:addr' \
  448. '*:files:_files'
  449. ;;
  450. vet)
  451. _arguments \
  452. '-all[check everything]' \
  453. '-asmdecl[check assembly against Go declarations]' \
  454. '-assign[check for useless assignments]' \
  455. '-atomic[check for common mistaken usages of the sync/atomic]' \
  456. '-bool[check for mistakes involving boolean operators]' \
  457. '-buildtags[check that +build tags are valid]' \
  458. '-composites[check that composite literals used field-keyed elements]' \
  459. '-compositewhitelist[use composite white list]' \
  460. '-copylocks[check that locks are not passed by value]' \
  461. '-methods[check that canonically named methods are canonically defined]' \
  462. '-nilfunc[check for comparisons between functions and nil]' \
  463. '-printf[check printf-like invocations]' \
  464. '-printfuncs[print function names to check]:string' \
  465. '-rangeloops[check that range loop variables are used correctly]' \
  466. '-shadow[check for shadowed variables]' \
  467. '-shadowstrict[whether to be strict about shadowing]' \
  468. '-shift[check for useless shifts]' \
  469. '-structtags[check that struct field tags have canonical format]' \
  470. '-tags[list of build tags to apply when parsing]:list' \
  471. '-test[for testing only: sets -all and -shadow]' \
  472. '-unreachable[check for unreachable code]' \
  473. '-unsafeptr[check for misuse of unsafe.Pointer]' \
  474. '-unusedfuncs[list of functions whose results must be used]:string' \
  475. '-unusedresult[check for unused result of calls to functions in -unusedfuncs]' \
  476. '-unusedstringmethods[list of methods whose results must be used]:string' \
  477. '-v[verbose]' \
  478. '*:files:_files'
  479. ;;
  480. yacc)
  481. _arguments \
  482. '-o[output]:output' \
  483. '-v[parsetable]:parsetable' \
  484. '*:files:_files'
  485. ;;
  486. esac
  487. ;;
  488. esac
  489. ;;
  490. vet)
  491. _arguments \
  492. '-n[print commands that would be executed]' \
  493. '-x[prints commands as they are executed]' \
  494. ${build_flags[@]} \
  495. '*:importpaths:__go_packages'
  496. ;;
  497. help)
  498. local -a topics
  499. topics=(
  500. 'c:calling between Go and C'
  501. 'buildmode:description of build modes'
  502. 'filetype:file types'
  503. 'gopath:GOPATH environment variable'
  504. 'environment:environment variables'
  505. 'importpath:import path syntax'
  506. 'packages:description of package lists'
  507. 'testflag:description of testing flags'
  508. 'testfunc:description of testing functions'
  509. )
  510. _arguments "1: :{_describe 'command' commands -- topics}"
  511. ;;
  512. esac
  513. ;;
  514. esac
  515. }
  516. _go