-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Just allows you to run `go` without actually having it installed. Maybe no one will use this but me, I don't know :) Release Note: None
- Loading branch information
1 parent
13c4d31
commit 8fcd494
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ go_library( | |
"dev.go", | ||
"doctor.go", | ||
"generate.go", | ||
"go.go", | ||
"lint.go", | ||
"logic.go", | ||
"main.go", | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2020 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package main | ||
|
||
import "github.com/spf13/cobra" | ||
|
||
func makeGoCmd(runE func(cmd *cobra.Command, args []string) error) *cobra.Command { | ||
return &cobra.Command{ | ||
Use: "go <arguments>", | ||
Short: "Run `go` with the given arguments", | ||
Long: "Run `go` with the given arguments", | ||
Example: "dev go mod tidy", | ||
Args: cobra.MinimumNArgs(0), | ||
RunE: runE, | ||
} | ||
} | ||
|
||
func (d *dev) gocmd(cmd *cobra.Command, commandLine []string) error { | ||
ctx := cmd.Context() | ||
args := []string{"run", "@go_sdk//:bin/go", "--ui_event_filters=-DEBUG,-info,-stdout,-stderr", "--noshow_progress", "--"} | ||
args = append(args, commandLine...) | ||
return d.exec.CommandContextInheritingStdStreams(ctx, "bazel", args...) | ||
} |