dotfiles/.bash_it/completion/available/go.completion.bash

16 lines
524 B
Bash
Raw Normal View History

2022-02-27 20:00:49 +01:00
# shellcheck shell=bash
about-completion "completion for go command using gocomplete"
# bash completion for go tool
# https://github.com/posener/complete
# Test `go version` because goenv creates shim scripts that will be found in PATH
# but do not always resolve to a working install.
if _command_exists go && go version &> /dev/null; then
# Same idea here, but no need to test a subcommand
if _command_exists gocomplete && gocomplete &> /dev/null; then
# finally, apply completion
complete -C gocomplete go
fi
fi