dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit f3fa445b2bd0efdf55c5645863920b499ca1f566
parent 35aa72a50a0c978d9e22f6d7c5930a91608c6823
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Thu,  1 Aug 2019 18:03:30 -0400

Git pre-commit: call "go fmt" if appropriate

Diffstat:
M.local/lib/gitdir/hooks/pre-commit | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/.local/lib/gitdir/hooks/pre-commit b/.local/lib/gitdir/hooks/pre-commit @@ -45,5 +45,10 @@ EOF exit 1 fi +if [ -f go.mod -o -f main.go ] +then + go fmt +fi + # If there are whitespace errors, print the offending file names and fail. exec git diff-index --check --cached $against --