Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@bopjiang
Created April 21, 2014 15:47
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bopjiang/11146574 to your computer and use it in GitHub Desktop.
Save bopjiang/11146574 to your computer and use it in GitHub Desktop.
create cscope index for go project
#!/bin/bash
# generate cscope index files in current directory
# the generated cscope index files also include go standard packages
if [ $GOROOT = "" ]
then
echo "GOROOT is not set"
exit 1
fi
go_pkg_src=$GOROOT/src/pkg
find $go_pkg_src -name "*.go" -print > cscope.files
find . -name "*.go" -print >> cscope.files
if cscope -b -k; then
echo "Done"
else
echo "Failed"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment