printf

package
v0.0.0-...-3f344d0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 License: GPL-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package printf defines an Analyzer that checks consistency of Printf format strings and arguments.

Index

Constants

View Source
const Doc = `` /* 1032-byte string literal not displayed */

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name:       "printf",
	Doc:        Doc,
	Requires:   []*analysis.Analyzer{inspect.Analyzer},
	Run:        run,
	ResultType: reflect.TypeOf((*Result)(nil)),
	FactTypes:  []analysis.Fact{new(isWrapper)},
}

Functions

This section is empty.

Types

type Kind

type Kind int

Kind is a kind of fmt function behavior.

const (
	KindNone   Kind = iota // not a fmt wrapper function
	KindPrint              // function behaves like fmt.Print
	KindPrintf             // function behaves like fmt.Printf
	KindErrorf             // function behaves like fmt.Errorf
)

func (Kind) String

func (kind Kind) String() string

type Result

type Result struct {
	// contains filtered or unexported fields
}

Result is the printf analyzer's result type. Clients may query the result to learn whether a function behaves like fmt.Print or fmt.Printf.

func (*Result) Kind

func (r *Result) Kind(fn *types.Func) Kind

Kind reports whether fn behaves like fmt.Print or fmt.Printf.

Jump to

Keyboard shortcuts

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