Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replacing single file to *.go wildcard for test and compile goals #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Support/gomate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,19 @@ def Go::go(command, options={})
if command == 'test' && ENV['TM_FILENAME'] =~ /(_test)?(\.go)$/
basename = $`
args.push("-v")
args.push("#{basename}.go")
args.push("#{basename}_test.go")

Dir.glob("#{ENV['TM_DIRECTORY']}/*.go").each do |f|
args.push(f)
end

opts[:chdir] = ENV['TM_DIRECTORY']
else
# At this time, we will always run 'go' against a single file. In the future there may be new
# commands that will invalidate this but until then, might as well start simple.
args.push(ENV['TM_FILEPATH'])
Dir.glob("#{ENV['TM_DIRECTORY']}/*.go").each do |f|
args.push(f)
end

end
args.push(opts)

Expand Down