Skip to content

Instantly share code, notes, and snippets.

@bkcsoft
Created December 27, 2016 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bkcsoft/231fc680d2706b50f72a6846621aafa3 to your computer and use it in GitHub Desktop.
Save bkcsoft/231fc680d2706b50f72a6846621aafa3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
PATHS=( `find $GOPATH/src -type d -name ${1} | sed "s;$GOPATH/src/;;"` )
for path in "${PATHS[@]}"; do
[[ ${path} =~ /vendor/ ]] && continue
test="${GOPATH}/src/${path}/.git"
if [[ -d "$GOPATH/src/${path}/.git" ]]; then
echo $path
fi
done
[bkc@bkc-work] $ gofind cli
github.com/codegangsta/cli
github.com/urfave/cli
[bkc@bkc-work] $ find $GOPATH/src -type d -name cli | sed "s;$GOPATH/src/;;"
github.com/gogits/gogs/vendor/github.com/urfave/cli
github.com/Masterminds/glide/vendor/github.com/codegangsta/cli
github.com/likexian/whois-go/cli
github.com/codegangsta/cli
github.com/derekparker/delve/Documentation/cli
github.com/gpmgo/gopm/modules/cli
github.com/urfave/cli
github.com/minio/minio/vendor/github.com/minio/cli
gogs.fulkod.se/BirdieScene/vote-system/vendor/github.com/urfave/cli
code.gitea.io/gitea/vendor/github.com/urfave/cli
gitlab.com/gitlab-org/gitlab-ci-multi-runner/helpers/cli
gitlab.com/gitlab-org/gitlab-ci-multi-runner/vendor/github.com/codegangsta/cli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment