Skip to content

Instantly share code, notes, and snippets.

@fukata
Created October 2, 2013 12:10
Show Gist options
  • Save fukata/6792725 to your computer and use it in GitHub Desktop.
Save fukata/6792725 to your computer and use it in GitHub Desktop.
Guardfile for golang
guard 'shell' do
watch(/.+\.go$/) do |m|
`gom test .`
end
watch(/(.+)\/.+\.go$/) do |m|
`gom test ./#{m[1]}`
end
# 現在編集中のファイルのみをテストしたい場合
# コレを利用する場合、上記のwatch文はコメントアウトした方が良い
#watch(/(.*)\/.+\.go$/) do |m|
# `gom test ./hoge/const.go ./hoge/hoge.go ./hoge/foo*`
#end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment