golang.org/x/tools@v0.21.0/internal/gocommand/invoke_test.go (about)

     1  // Copyright 2020 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package gocommand_test
     6  
     7  import (
     8  	"context"
     9  	"testing"
    10  
    11  	"golang.org/x/tools/internal/gocommand"
    12  	"golang.org/x/tools/internal/testenv"
    13  )
    14  
    15  func TestGoVersion(t *testing.T) {
    16  	testenv.NeedsTool(t, "go")
    17  
    18  	inv := gocommand.Invocation{
    19  		Verb: "version",
    20  	}
    21  	gocmdRunner := &gocommand.Runner{}
    22  	if _, err := gocmdRunner.Run(context.Background(), inv); err != nil {
    23  		t.Error(err)
    24  	}
    25  }