Name: lpk
Owner: go-br
Description: Find go projects/packages in your GOPATH
Created: 2017-02-24 12:59:08.0
Updated: 2018-02-19 21:49:23.0
Pushed: 2018-02-19 22:05:11.0
Size: 17
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A small utility that looks for package in your GOPATH and returns the full path to the package directory.
All my projects are in GOPATH and I got tired of typing cd and the full path to the package/software directory.
So I created this little utility that looks in GOPATH and returns the full path to the project, so I can create an alias to change to the project directory and also can search by the project by name, etc.
et github.com/go-br/lpk
Search for the project in GOPATH and displays the full path type lpk project where project is the name of the package or software you are looking for. By default, lpk stops searching after it encounters the first occurrence.
project
To list all project occurrences use the parameter -list with “all” string
-list=all project
This command will list all the project occurrences including those found in the vendor directly, to ignore the vendor add skipvendor to the -list parameter
-list=all,skipvendor project
Changes to the project directory automatically
(lpk project)
Set up an alias for the cd and jump straight to your project directory. Example, let's say you want to create an alias to jump directly to the project directory. Just change project by project name in your GOPATH
s aliasname="cd $(lpk project)"
Another tip, if you are using macOS the following command creates an alias to open the Finder in the project directory. Remember to change the word project by the name of your project in GOPATH
s aliasname="open $(lpk project)"
git checkout -b fantastic-feature
.git commit -m 'Implementation of new fantastic feature'
git push origin fantastic-feature
.