From 26a96cbcd9a110081cd0527b22116b8cab512d52 Mon Sep 17 00:00:00 2001 From: blallo Date: Tue, 6 Feb 2024 18:04:36 +0100 Subject: [PATCH] Update go utils --- .zshrc.graphic | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.zshrc.graphic b/.zshrc.graphic index 4b41575..fe05317 100644 --- a/.zshrc.graphic +++ b/.zshrc.graphic @@ -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