tools: golang.org/x/tools/go/analysis/passes/printf Index | Files

package printf

import "golang.org/x/tools/go/analysis/passes/printf"

Index

Package Files

printf.go types.go

Variables

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)},
}

type Kind Uses

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 Uses

func (kind Kind) String() string

type Result Uses

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 Uses

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

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

Package printf imports 17 packages (graph) and is imported by 10 packages. Updated 2019-11-17. Refresh now. Tools for package owners.