parent
							
								
									a50d486f6d
								
							
						
					
					
						commit
						499e5be22e
					
				
							
								
								
									
										97
									
								
								src/_golang
								
								
								
								
							
							
						
						
									
										97
									
								
								src/_golang
								
								
								
								
							| 
						 | 
					@ -45,8 +45,7 @@
 | 
				
			||||||
# ------------------------------------------------------------------------------
 | 
					# ------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
__go_buildmodes() {
 | 
					__go_buildmodes() {
 | 
				
			||||||
  local -a buildmodes
 | 
					  local -a buildmodes=(
 | 
				
			||||||
  buildmodes=(
 | 
					 | 
				
			||||||
    'archive[non-main packages into .a files]'
 | 
					    'archive[non-main packages into .a files]'
 | 
				
			||||||
    'c-archive[main package, plus all packages it imports, into a C archive file]'
 | 
					    'c-archive[main package, plus all packages it imports, into a C archive file]'
 | 
				
			||||||
    'c-shared[main package, plus all packages it imports, into a C shared library]'
 | 
					    'c-shared[main package, plus all packages it imports, into a C shared library]'
 | 
				
			||||||
| 
						 | 
					@ -60,10 +59,8 @@ __go_buildmodes() {
 | 
				
			||||||
  _values 'mode' $buildmodes
 | 
					  _values 'mode' $buildmodes
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
__go_runtimedebug() {
 | 
					__go_runtimedebug() {
 | 
				
			||||||
  local -a vars
 | 
					  local -a vars=(
 | 
				
			||||||
  vars=(
 | 
					 | 
				
			||||||
    'allocfreetrace[profile allocations]:boolean:(1 0)'
 | 
					    'allocfreetrace[profile allocations]:boolean:(1 0)'
 | 
				
			||||||
    'clobberfree[clobber memory after free]:boolean:(1 0)'
 | 
					    'clobberfree[clobber memory after free]:boolean:(1 0)'
 | 
				
			||||||
    'cgocheck[check passing go pointers to non-go]: :((0\:"no checks" 1\:"check checks" 2\:"expensive checks"))'
 | 
					    'cgocheck[check passing go pointers to non-go]: :((0\:"no checks" 1\:"check checks" 2\:"expensive checks"))'
 | 
				
			||||||
| 
						 | 
					@ -173,7 +170,7 @@ __go_gcflags() {
 | 
				
			||||||
    '-trimpath=[remove prefix from recorded source file paths]:prefix' \
 | 
					    '-trimpath=[remove prefix from recorded source file paths]:prefix' \
 | 
				
			||||||
    '-v[increase debug verbosity]' \
 | 
					    '-v[increase debug verbosity]' \
 | 
				
			||||||
    '-w[debug type checking]' \
 | 
					    '-w[debug type checking]' \
 | 
				
			||||||
  '-wb[enable write barrier (default true)]' \
 | 
					    '-wb[enable write barrier (default true)]'
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
__go_pgo() {
 | 
					__go_pgo() {
 | 
				
			||||||
| 
						 | 
					@ -182,27 +179,27 @@ __go_pgo() {
 | 
				
			||||||
    "file:file:_files"
 | 
					    "file:file:_files"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local -a commands build_flags
 | 
					local -a build_flags
 | 
				
			||||||
commands=(
 | 
					local -a commands=(
 | 
				
			||||||
'bug:start a bug report'
 | 
					  'bug:start a bug report'
 | 
				
			||||||
'build:compile packages and dependencies'
 | 
					  'build:compile packages and dependencies'
 | 
				
			||||||
'clean:remove object files and cached files'
 | 
					  'clean:remove object files and cached files'
 | 
				
			||||||
'doc:show documentation for package or symbol'
 | 
					  'doc:show documentation for package or symbol'
 | 
				
			||||||
'env:print Go environment information'
 | 
					  'env:print Go environment information'
 | 
				
			||||||
'fix:update packages to use new APIs'
 | 
					  'fix:update packages to use new APIs'
 | 
				
			||||||
'fmt:gofmt (reformat) package sources'
 | 
					  'fmt:gofmt (reformat) package sources'
 | 
				
			||||||
'generate:generate Go files by processing source'
 | 
					  'generate:generate Go files by processing source'
 | 
				
			||||||
'get:download and install packages and dependencies'
 | 
					  'get:download and install packages and dependencies'
 | 
				
			||||||
'install:compile and install packages and dependencies'
 | 
					  'install:compile and install packages and dependencies'
 | 
				
			||||||
'list:list packages or modules'
 | 
					  'list:list packages or modules'
 | 
				
			||||||
'mod:module maintenance'
 | 
					  'mod:module maintenance'
 | 
				
			||||||
'work:workspace maintenance'
 | 
					  'work:workspace maintenance'
 | 
				
			||||||
'run:compile and run Go program'
 | 
					  'run:compile and run Go program'
 | 
				
			||||||
'test:test packages'
 | 
					  'test:test packages'
 | 
				
			||||||
'tool:run specified go tool'
 | 
					  'tool:run specified go tool'
 | 
				
			||||||
'version:print Go version'
 | 
					  'version:print Go version'
 | 
				
			||||||
'vet:report likely mistakes in packages'
 | 
					  'vet:report likely mistakes in packages'
 | 
				
			||||||
'help:get more information about a command'
 | 
					  'help:get more information about a command'
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
__go_envvarvals() {
 | 
					__go_envvarvals() {
 | 
				
			||||||
| 
						 | 
					@ -368,21 +365,20 @@ case $state in
 | 
				
			||||||
      '-trimpath[remove all file system paths from the resulting executable]'
 | 
					      '-trimpath[remove all file system paths from the resulting executable]'
 | 
				
			||||||
      '-toolexec[program to use to invoke toolchain programs]:args'
 | 
					      '-toolexec[program to use to invoke toolchain programs]:args'
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
    mod_flags=(
 | 
					    local -a mod_flags=(
 | 
				
			||||||
      '-mod=[module download mode to use]:download mode:(readonly vendor mod)'
 | 
					      '-mod=[module download mode to use]:download mode:(readonly vendor mod)'
 | 
				
			||||||
      '-modcacherw[leave newly-created directories in the module cache read-write]'
 | 
					      '-modcacherw[leave newly-created directories in the module cache read-write]'
 | 
				
			||||||
      '-modfile=[read an alternate go.mod file]:modfile: _files -g "*.mod"'
 | 
					      '-modfile=[read an alternate go.mod file]:modfile: _files -g "*.mod"'
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					    local -a edit_flags=(
 | 
				
			||||||
    edit_flags=(
 | 
					      '-fmt[reformats the go.mod/work file without making other changes]'
 | 
				
			||||||
    '-fmt[reformats the go.mod/work file without making other changes]' \
 | 
					      '*-require=[add a requirement on the given module path and version]:require'
 | 
				
			||||||
    '*-require=[add a requirement on the given module path and version]:require' \
 | 
					      '*-droprequire=[drop a requirement on the given module path and version]:droprequire'
 | 
				
			||||||
    '*-droprequire=[drop a requirement on the given module path and version]:droprequire' \
 | 
					      '-go[sets the expected Go language version]:goversion'
 | 
				
			||||||
    '-go[sets the expected Go language version]:goversion' \
 | 
					      '*-replace=[add a replacement of the given module path and version]:replace'
 | 
				
			||||||
    '*-replace=[add a replacement of the given module path and version]:replace' \
 | 
					      '*-dropreplace=[drop a replacement of the given module path and version]:dropreplace'
 | 
				
			||||||
    '*-dropreplace=[drop a replacement of the given module path and version]:dropreplace' \
 | 
					      '-json[prints the final go.mod/work file in JSON format]'
 | 
				
			||||||
    '-json[prints the final go.mod/work file in JSON format]' \
 | 
					      '-print[prints the final go.mod/work in its text format]'
 | 
				
			||||||
    '-print[prints the final go.mod/work in its text format]' \
 | 
					 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    __go_packages() {
 | 
					    __go_packages() {
 | 
				
			||||||
| 
						 | 
					@ -438,8 +434,7 @@ case $state in
 | 
				
			||||||
          ;;
 | 
					          ;;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      env)
 | 
					      env)
 | 
				
			||||||
        local -a goenvvars
 | 
					        local -a goenvvars=(
 | 
				
			||||||
        goenvvars=(
 | 
					 | 
				
			||||||
          "GOARCH[architecture, or processor, for which to compile code.]:architecture"
 | 
					          "GOARCH[architecture, or processor, for which to compile code.]:architecture"
 | 
				
			||||||
          "GCCGO[gccgo command to run.]:gccgo command"
 | 
					          "GCCGO[gccgo command to run.]:gccgo command"
 | 
				
			||||||
          "GOBIN[directory where 'go install' installs to]:go install target dir"
 | 
					          "GOBIN[directory where 'go install' installs to]:go install target dir"
 | 
				
			||||||
| 
						 | 
					@ -497,8 +492,7 @@ case $state in
 | 
				
			||||||
          "GOMOD[absolute path the the main go.mod]:abs path to main go.mod"
 | 
					          "GOMOD[absolute path the the main go.mod]:abs path to main go.mod"
 | 
				
			||||||
          "GOTOOLDIR[installation directory of go tools]:tool installation directory"
 | 
					          "GOTOOLDIR[installation directory of go tools]:tool installation directory"
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
        local -a exclude_from_w
 | 
					        local -a exclude_from_w=(GOENV)
 | 
				
			||||||
        exclude_from_w=(GOENV)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        __list_env_vars() {
 | 
					        __list_env_vars() {
 | 
				
			||||||
          # the parameter expansion strops off everything after the first [
 | 
					          # the parameter expansion strops off everything after the first [
 | 
				
			||||||
| 
						 | 
					@ -559,8 +553,7 @@ case $state in
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      list)
 | 
					      list)
 | 
				
			||||||
        local -a list_args
 | 
					        local -a list_args=(
 | 
				
			||||||
        list_args=(
 | 
					 | 
				
			||||||
          '-e[changes the handling of erroneous packages]'
 | 
					          '-e[changes the handling of erroneous packages]'
 | 
				
			||||||
          '-f[specifies an alternate format for the list]:format'
 | 
					          '-f[specifies an alternate format for the list]:format'
 | 
				
			||||||
          '-json[causes package data to be printed in JSON format]'
 | 
					          '-json[causes package data to be printed in JSON format]'
 | 
				
			||||||
| 
						 | 
					@ -582,8 +575,7 @@ case $state in
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      mod)
 | 
					      mod)
 | 
				
			||||||
        local -a mod_commands
 | 
					        local -a mod_commands=(
 | 
				
			||||||
        mod_commands=(
 | 
					 | 
				
			||||||
          'download:download modules to local cache'
 | 
					          'download:download modules to local cache'
 | 
				
			||||||
          'edit:edit go.mod from tools or scripts'
 | 
					          'edit:edit go.mod from tools or scripts'
 | 
				
			||||||
          'graph:print module requirement graph'
 | 
					          'graph:print module requirement graph'
 | 
				
			||||||
| 
						 | 
					@ -763,14 +755,13 @@ case $state in
 | 
				
			||||||
                ;;
 | 
					                ;;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
              callgraph)
 | 
					              callgraph)
 | 
				
			||||||
                local -a algos graphs
 | 
					                local -a algos=(
 | 
				
			||||||
                algos=(
 | 
					 | 
				
			||||||
                  'static:static calls only'
 | 
					                  'static:static calls only'
 | 
				
			||||||
                  'cha:Class Hierarchy Analysis'
 | 
					                  'cha:Class Hierarchy Analysis'
 | 
				
			||||||
                  'rta:Rapid Type Analysis'
 | 
					                  'rta:Rapid Type Analysis'
 | 
				
			||||||
                  'pta:inclusion-based Points-To Analysis'
 | 
					                  'pta:inclusion-based Points-To Analysis'
 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
                graphs=(
 | 
					                local -a graphs=(
 | 
				
			||||||
                  'digraph:output in digraph format'
 | 
					                  'digraph:output in digraph format'
 | 
				
			||||||
                  'graphviz:output in AT&T GraphViz (.dot) format'
 | 
					                  'graphviz:output in AT&T GraphViz (.dot) format'
 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
| 
						 | 
					@ -1052,7 +1043,6 @@ case $state in
 | 
				
			||||||
          '*:files:_files'
 | 
					          '*:files:_files'
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
      vet)
 | 
					      vet)
 | 
				
			||||||
        _arguments \
 | 
					        _arguments \
 | 
				
			||||||
          '-n[print commands that would be executed]' \
 | 
					          '-n[print commands that would be executed]' \
 | 
				
			||||||
| 
						 | 
					@ -1062,8 +1052,7 @@ case $state in
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      work)
 | 
					      work)
 | 
				
			||||||
        local -a work_commands
 | 
					        local -a work_commands=(
 | 
				
			||||||
        work_commands=(
 | 
					 | 
				
			||||||
          'edit:edit go.work from tools or scripts'
 | 
					          'edit:edit go.work from tools or scripts'
 | 
				
			||||||
          'init:initialize workspace file'
 | 
					          'init:initialize workspace file'
 | 
				
			||||||
          'sync:sync workspace build list to modules'
 | 
					          'sync:sync workspace build list to modules'
 | 
				
			||||||
| 
						 | 
					@ -1103,10 +1092,8 @@ case $state in
 | 
				
			||||||
        esac
 | 
					        esac
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
      help)
 | 
					      help)
 | 
				
			||||||
        local -a topics
 | 
					        local -a topics=(
 | 
				
			||||||
        topics=(
 | 
					 | 
				
			||||||
          'buildconstraint:build constraints'
 | 
					          'buildconstraint:build constraints'
 | 
				
			||||||
          'buildmode:build modes'
 | 
					          'buildmode:build modes'
 | 
				
			||||||
          'c:calling between Go and C'
 | 
					          'c:calling between Go and C'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue