github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/go/internal/vet/vet.go (about)

     1  // Copyright 2011 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 vet implements the “go vet” command.
     6  package vet
     7  
     8  import (
     9  	"github.com/shogo82148/std/cmd/go/internal/base"
    10  )
    11  
    12  var CmdVet = &base.Command{
    13  	CustomFlags: true,
    14  	UsageLine:   "go vet [build flags] [-vettool prog] [vet flags] [packages]",
    15  	Short:       "report likely mistakes in packages",
    16  	Long: `
    17  Vet runs the Go vet command on the packages named by the import paths.
    18  
    19  For more about vet and its flags, see 'go doc cmd/vet'.
    20  For more about specifying packages, see 'go help packages'.
    21  For a list of checkers and their flags, see 'go tool vet help'.
    22  For details of a specific checker such as 'printf', see 'go tool vet help printf'.
    23  
    24  The -vettool=prog flag selects a different analysis tool with alternative
    25  or additional checks.
    26  For example, the 'shadow' analyzer can be built and run using these commands:
    27  
    28    go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
    29    go vet -vettool=$(which shadow)
    30  
    31  The build flags supported by go vet are those that control package resolution
    32  and execution, such as -C, -n, -x, -v, -tags, and -toolexec.
    33  For more about these flags, see 'go help build'.
    34  
    35  See also: go fmt, go fix.
    36  	`,
    37  }