analyzers

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AtomicStd = &analysis.Analyzer{
	Name: "atomicstd",
	Doc:  "check for raw sync/atomic function calls instead of typed values (Uber Go Style Guide: Use sync/atomic typed values)",
	URL:  "https://github.com/uber-go/guide#use-gouberorgatomic",
	Run:  runAtomicStd,
}
View Source
var ChanSize = &analysis.Analyzer{
	Name: "chansize",
	Doc:  "check that channel size is 0 or 1 (Uber Go Style Guide: Channel Size is One or None)",
	URL:  "https://github.com/uber-go/guide#channel-size-is-one-or-none",
	Run:  runChanSize,
}
View Source
var ConstPrintf = &analysis.Analyzer{
	Name: "constprintf",
	Doc:  "check non-const printf format string variables (Uber Go Style Guide: Format Strings outside Printf)",
	URL:  "https://github.com/uber-go/guide#format-strings-outside-printf",
	Run:  runConstPrintf,
}
View Source
var EmbedLayout = &analysis.Analyzer{
	Name: "embedlayout",
	Doc:  "check that embedded struct fields are grouped before named fields (Uber Go Style Guide: Embedding in Structs)",
	URL:  "https://github.com/uber-go/guide#embedding-in-structs",
	Run:  runEmbedLayout,
}
View Source
var EnumStart = &analysis.Analyzer{
	Name: "enumstart",
	Doc:  "check that enum constants start at a non-zero value (Uber Go Style Guide: Start Enums at One)",
	URL:  "https://github.com/uber-go/guide#start-enums-at-one",
	Run:  runEnumStart,
}
View Source
var GlobalPrefix = &analysis.Analyzer{
	Name: "globalprefix",
	Doc:  "check that unexported top-level vars and consts are prefixed with _ (Uber Go Style Guide: Prefix Unexported Globals with _)",
	URL:  "https://github.com/uber-go/guide#prefix-unexported-globals-with-_",
	Run:  runGlobalPrefix,
}
View Source
var IfacePtr = &analysis.Analyzer{
	Name: "ifaceptr",
	Doc:  "check for pointer-to-interface types (Uber Go Style Guide: Pointers to Interfaces)",
	URL:  "https://github.com/uber-go/guide#pointers-to-interfaces",
	Run:  runIfacePtr,
}
View Source
var LocalVar = &analysis.Analyzer{
	Name: "localvar",
	Doc:  "check for local var declarations that should use := (Uber Go Style Guide: Local Variable Declarations)",
	URL:  "https://github.com/uber-go/guide#local-variable-declarations",
	Run:  runLocalVar,
}
View Source
var MapInit = &analysis.Analyzer{
	Name: "mapinit",
	Doc:  "check empty map literals that should use make (Uber Go Style Guide: Initializing Maps)",
	URL:  "https://github.com/uber-go/guide#initializing-maps",
	Run:  runMapInit,
}
View Source
var NakedParams = &analysis.Analyzer{
	Name: "nakedparams",
	Doc:  "check calls with multiple naked literal parameters (Uber Go Style Guide: Avoid Naked Parameters)",
	URL:  "https://github.com/uber-go/guide#avoid-naked-parameters",
	Run:  runNakedParams,
}
View Source
var NewRef = &analysis.Analyzer{
	Name: "newref",
	Doc:  "check for new(T) instead of &T{} (Uber Go Style Guide: Initializing Struct References)",
	URL:  "https://github.com/uber-go/guide#initializing-struct-references",
	Run:  runNewRef,
}
View Source
var NilSlice = &analysis.Analyzer{
	Name: "nilslice",
	Doc:  "check for empty slice literals where nil should be used (Uber Go Style Guide: nil is a valid slice)",
	URL:  "https://github.com/uber-go/guide#nil-is-a-valid-slice",
	Run:  runNilSlice,
}
View Source
var NoPanic = &analysis.Analyzer{
	Name: "nopanic",
	Doc:  "check for panic() calls in production code (Uber Go Style Guide: Don't Panic)",
	URL:  "https://github.com/uber-go/guide#dont-panic",
	Run:  runNoPanic,
}
View Source
var PublicEmbed = &analysis.Analyzer{
	Name: "publicembed",
	Doc:  "check for embedded fields in public structs (Uber Go Style Guide: Avoid Embedding Types in Public Structs)",
	URL:  "https://github.com/uber-go/guide#avoid-embedding-types-in-public-structs",
	Run:  runPublicEmbed,
}
View Source
var RawString = &analysis.Analyzer{
	Name: "rawstring",
	Doc:  "check for string literals with escaped quotes that could use backticks (Uber Go Style Guide: Use Raw String Literals to Avoid Escaping)",
	URL:  "https://github.com/uber-go/guide#use-raw-string-literals-to-avoid-escaping",
	Run:  runRawString,
}
View Source
var StringBytes = &analysis.Analyzer{
	Name: "stringbytes",
	Doc:  "check for repeated string-to-byte conversions inside loops (Uber Go Style Guide: Avoid repeated string-to-byte conversions)",
	URL:  "https://github.com/uber-go/guide#avoid-repeated-string-to-byte-conversions",
	Run:  runStringBytes,
}
View Source
var TimeField = &analysis.Analyzer{
	Name: "timefield",
	Doc:  "check serialized numeric time fields for unit suffixes (Uber Go Style Guide: Time with External Systems)",
	URL:  "https://github.com/uber-go/guide#use-time-with-external-systems",
	Run:  runTimeField,
}
View Source
var VarType = &analysis.Analyzer{
	Name: "vartype",
	Doc:  "check for redundant type in top-level var declarations (Uber Go Style Guide: Top-level Variable Declarations)",
	URL:  "https://github.com/uber-go/guide#top-level-variable-declarations",
	Run:  runVarType,
}
View Source
var ZeroFields = &analysis.Analyzer{
	Name: "zerofields",
	Doc:  "check for explicit zero-value fields in struct literals (Uber Go Style Guide: Omit Zero Value Fields in Structs)",
	URL:  "https://github.com/uber-go/guide#omit-zero-value-fields-in-structs",
	Run:  runZeroFields,
}
View Source
var ZeroVar = &analysis.Analyzer{
	Name: "zerovar",
	Doc:  "check for T{} short decl where var T should be used (Uber Go Style Guide: Use var for Zero Value Structs)",
	URL:  "https://github.com/uber-go/guide#use-var-for-zero-value-structs",
	Run:  runZeroVar,
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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