diff options
author | Rob Findley <rfindley@google.com> | 2020-04-22 11:50:56 -0400 |
---|---|---|
committer | Robert Findley <rfindley@google.com> | 2020-04-22 17:07:37 +0000 |
commit | 3d37a677963775f298425e28f9ebc473003bee39 (patch) | |
tree | e448ca4425591593c481412b18e7a591d8d85061 | |
parent | 3d57cf2e726ef4a8e496ce4f80c680a74250b8d9 (diff) | |
download | golang-x-tools-3d37a677963775f298425e28f9ebc473003bee39.tar.gz |
internal/gocommand: clean up docstring typos and staticcheck errors
Fix a couple typos in the RunRaw docstring, as well as some superficial
staticcheck errors.
Change-Id: I557d7ee63366b2b3a82d590d69ee2907d4e3ac59
Reviewed-on: https://go-review.googlesource.com/c/tools/+/229417
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
-rw-r--r-- | internal/gocommand/invoke.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/gocommand/invoke.go b/internal/gocommand/invoke.go index 5b1341270..19ecaea6f 100644 --- a/internal/gocommand/invoke.go +++ b/internal/gocommand/invoke.go @@ -39,7 +39,7 @@ func (runner *Runner) Run(ctx context.Context, inv Invocation) (*bytes.Buffer, e return stdout, friendly } -// Run calls Innvocation.RunRaw, serializing requests if they fight over +// RunRaw calls Invocation.runRaw, serializing requests if they fight over // go.mod changes. func (runner *Runner) RunRaw(ctx context.Context, inv Invocation) (*bytes.Buffer, *bytes.Buffer, error, error) { // We want to run invocations concurrently as much as possible. However, @@ -93,6 +93,7 @@ func (i *Invocation) runRaw(ctx context.Context) (stdout *bytes.Buffer, stderr * stderr = &bytes.Buffer{} rawError = i.RunPiped(ctx, stdout, stderr) if rawError != nil { + friendlyError = rawError // Check for 'go' executable not being found. if ee, ok := rawError.(*exec.Error); ok && ee.Err == exec.ErrNotFound { friendlyError = fmt.Errorf("go command required, not found: %v", ee) @@ -100,7 +101,7 @@ func (i *Invocation) runRaw(ctx context.Context) (stdout *bytes.Buffer, stderr * if ctx.Err() != nil { friendlyError = ctx.Err() } - friendlyError = fmt.Errorf("err: %v: stderr: %s", rawError, stderr) + friendlyError = fmt.Errorf("err: %v: stderr: %s", friendlyError, stderr) } return } |