Skip to content

Instantly share code, notes, and snippets.

@adrianbiro
Created June 16, 2022 10:57
Show Gist options
  • Save adrianbiro/9d51d2ed2dee9c72fb156437b49543ad to your computer and use it in GitHub Desktop.
Save adrianbiro/9d51d2ed2dee9c72fb156437b49543ad to your computer and use it in GitHub Desktop.
Bash competition for go
#!/bin/bash
function completego()
# Bash completion for go
{
local wordlist; wordlist=$(go help | awk 'NR==9, NR==26{ printf "%s%s", $1, sp = NR==26? "\n": " "}')
complete -W "${wordlist}" go
}
completego
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment