toolsgolang.org/x/tools/go/analysis/singlechecker Index | Files

package singlechecker

import "golang.org/x/tools/go/analysis/singlechecker"

Package singlechecker defines the main function for an analysis driver with only a single analysis. This package makes it easy for a provider of an analysis package to also provide a standalone tool that runs just that analysis.

For example, if example.org/findbadness is an analysis package, all that is needed to define a standalone tool is a file, example.org/findbadness/cmd/findbadness/main.go, containing:

// The findbadness command runs an analysis.
package main

import (
	"example.org/findbadness"
	"golang.org/x/tools/go/analysis/singlechecker"
)

func main() { singlechecker.Main(findbadness.Analyzer) }

Index

Functions

func Main

func Main(a *analysis.Analyzer)

Main is the main function for a checker command for a single analysis.

Source Files

singlechecker.go

Version
v0.30.0 (latest)
Published
Feb 10, 2025
Platform
linux/amd64
Imports
9 packages
Last checked
3 hours ago

Tools for package owners.