Mar
10th
Wed
10th
go: git precommit hook for gofmt
It’s no surprise I like Ruby, and gofmt is a great idea I wish Ruby could enforce. Instead of forgetting to run it constantly, let’s have git run it. In your
.git/hooks/pre-commit:#!/usr/bin/env ruby Dir["**/*.go"].each do |go| if File.basename(go) !~ /^_/ puts "gofmt #{go}" system("gofmt...
Ruby with enforced gofmt… ah yes, Python :)