From 17a7bfc99193977b3489fab3b3198688b334c6ae Mon Sep 17 00:00:00 2001 From: Pinghao Wu Date: Thu, 14 Sep 2023 12:06:38 +0800 Subject: [PATCH] bash: add gogrep --- .bashrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.bashrc b/.bashrc index 89d0503..9a0399c 100644 --- a/.bashrc +++ b/.bashrc @@ -123,6 +123,10 @@ st() { head -c 100M /dev/urandom | curl -q "$ST_SERVER" -m 10 --data-binary @- >/dev/null } +gogrep() { + IFS=$'\n' grep "$@" $(go list -deps -f '{{range .GoFiles}}{{printf "%s/%s\n" $.Dir .}}{{end}}') +} + # application envs export GPG_TTY=$(tty 2>/dev/null) -- 2.43.0