Last active
December 26, 2015 17:48
-
-
Save Integralist/b675a263897680e02fbd to your computer and use it in GitHub Desktop.
Go Guardfile: `bundle exec guard`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "https://rubygems.org" | |
gem "guard" | |
gem "guard-shell" | |
gem "terminal-notifier" # brew upgrade terminal-notifier | |
gem "terminal-notifier-guard" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "terminal-notifier-guard" | |
guard :shell do | |
watch(/(.*).go/) do |m| | |
puts "m: #{m}" # m: ["file-that-was-modified", "folder-file-sits-inside"] | |
issues = "" | |
`golint #{m.first}`.tap { |res| issues = res } | |
puts "\nissues:\n#{issues}" unless issues.empty? | |
`go run #{m.first}` if issues.empty? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alternative that works with long running go programs (such as a web server)...