inspectsql

package
v0.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const Doc = `find calls to database/sql with query string not a safesql.SQL`

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name:             "inspectsql",
	Doc:              Doc,
	URL:              "https://pkg.go.dev/github.com/tgulacsi/go/safesql/inspectsql",
	Run:              run,
	RunDespiteErrors: true,
	Requires:         []*analysis.Analyzer{inspect.Analyzer, typeindex.Analyzer},
	FactTypes:        []analysis.Fact{(*SQLQuery)(nil)},
	ResultType:       reflect.TypeFor[[]string](),
}

Functions

This section is empty.

Types

type SQLQuery

type SQLQuery struct {
	token.Position
	Query string
}

foundFact is a fact associated with functions that match -name. We use it to exercise the fact machinery in tests.

func (*SQLQuery) AFact

func (*SQLQuery) AFact()

func (*SQLQuery) String

func (qry *SQLQuery) String() string

Directories

Path Synopsis
Package typeindex defines an analyzer that provides a golang.org/x/tools/internal/typesinternal/typeindex.Index.
Package typeindex defines an analyzer that provides a golang.org/x/tools/internal/typesinternal/typeindex.Index.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL