Update go utils
This commit is contained in:
parent
3ff115320c
commit
26a96cbcd9
1 changed files with 6 additions and 4 deletions
|
@ -325,14 +325,16 @@ fi
|
|||
### colored and fuzzy go doc
|
||||
if which bat > /dev/null; then
|
||||
function _godoc() {
|
||||
local PAGE_LANG=go
|
||||
local GO_LANG=go
|
||||
if echo $1|grep -q -E "^([a-zA-Z0-9/]+)$"; then
|
||||
go doc ${@} | bat -p -l md
|
||||
go doc ${@} | bat -p -l ${PAGE_LANG}
|
||||
elif echo $1|grep -q -E "^[a-zA-Z0-9/]+\.[a-zA-Z0-9.]+$"; then
|
||||
go doc ${@} | bat -p -l go
|
||||
go doc ${@} | bat -p -l ${GO_LANG}
|
||||
elif echo $1|grep -q -E "^([a-zA-Z0-9/._-]+)/.*\.[a-zA-Z0-9.]+$"; then
|
||||
go doc ${@} | bat -p -l go
|
||||
go doc ${@} | bat -p -l ${GO_LANG}
|
||||
else
|
||||
go doc ${@} | bat -p -l md
|
||||
go doc ${@} | bat -p -l ${PAGE_LANG}
|
||||
fi
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue