Skip to content

Commit 9abc925

Browse files
committed
Migrate to GoGem::RakeTask
1 parent 41a9a50 commit 9abc925

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

_tasks/go.rake

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
# frozen_string_literal: true
22

3-
namespace :go do
4-
desc "Run go test"
5-
task :test do
6-
sh GoGem::RakeTask.build_env_vars, "go test -mod=readonly -count=1 #{ENV["GO_TEST_ARGS"]} ./..."
7-
end
8-
9-
desc "Run go test -race"
10-
task :testrace do
11-
sh GoGem::RakeTask.build_env_vars, "go test -mod=readonly -count=1 #{ENV["GO_TEST_ARGS"]} -race ./..."
12-
end
13-
14-
desc "Run go fmt"
15-
task :fmt do
16-
sh "go fmt ./..."
17-
end
3+
GoGem::RakeTask.new("") do |t|
4+
t.target_dir = repo_root
5+
t.go_test_args = "#{GoGem::RakeTask::DEFAULT_GO_TEST_ARGS} #{ENV["GO_TEST_ARGS"]}"
6+
end
187

8+
namespace :go do
199
desc "Run golangci-lint"
2010
task :lint do
2111
sh "which golangci-lint" do |ok, _|

0 commit comments

Comments
 (0)