Git Hooks for your Golang project

I have been developing in JavaScript for a while now and one of my favourite tool was husky but when I started developing on golang I really missed the husky tool to manage my git hooks so I created a spin off to husky written in golang.

Check it out…


This content originally appeared on DEV Community and was authored by DEV Community

I have been developing in JavaScript for a while now and one of my favourite tool was husky but when I started developing on golang I really missed the husky tool to manage my git hooks so I created a spin off to husky written in golang.

Check it out

Lets see how you can use it?

Captain Hook

Installation

go install github.com/automation-co/husky@latest

Getting Started

You can initialise husky by $ husky init

Make sure you have git initialised

This will make the .husky folder with the hooks folder and a sample pre-commit hook

You can add hooks using

$ husky add <hook> "
  <your commands for that hook>
"

Example

$ husky add pre-commit "
  go build -v ./... 
  go test -v ./...
"

If you have made any other changes in the hooks you can appply them by using $ husky install

Get Familiar with Git Hooks

Learn more about git hooks from these useful resources:

Other Alternatives

If you feel husky does not fulfill your needs you can also check out:


This content originally appeared on DEV Community and was authored by DEV Community


Print Share Comment Cite Upload Translate Updates
APA

DEV Community | Sciencx (2022-03-07T05:42:32+00:00) Git Hooks for your Golang project. Retrieved from https://www.scien.cx/2022/03/07/git-hooks-for-your-golang-project/

MLA
" » Git Hooks for your Golang project." DEV Community | Sciencx - Monday March 7, 2022, https://www.scien.cx/2022/03/07/git-hooks-for-your-golang-project/
HARVARD
DEV Community | Sciencx Monday March 7, 2022 » Git Hooks for your Golang project., viewed ,<https://www.scien.cx/2022/03/07/git-hooks-for-your-golang-project/>
VANCOUVER
DEV Community | Sciencx - » Git Hooks for your Golang project. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/03/07/git-hooks-for-your-golang-project/
CHICAGO
" » Git Hooks for your Golang project." DEV Community | Sciencx - Accessed . https://www.scien.cx/2022/03/07/git-hooks-for-your-golang-project/
IEEE
" » Git Hooks for your Golang project." DEV Community | Sciencx [Online]. Available: https://www.scien.cx/2022/03/07/git-hooks-for-your-golang-project/. [Accessed: ]
rf:citation
» Git Hooks for your Golang project | DEV Community | Sciencx | https://www.scien.cx/2022/03/07/git-hooks-for-your-golang-project/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.