Version: v0.2.6 Latest Latest

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

Go to latest
Published: Mar 28, 2022 License: MIT Imports: 14 Imported by: 0




This section is empty.


This section is empty.


func CheckRangeStringRunes

func CheckRangeStringRunes(pass *analysis.Pass) (interface{}, error)

func RedundantTypeInDeclarationChecker

func RedundantTypeInDeclarationChecker(verb string, flagHelpfulTypes bool) *analysis.Analyzer

RedundantTypeInDeclarationChecker returns a checker that flags variable declarations with redundantly specified types. That is, it flags 'var v T = e' where e's type is identical to T and 'var v = e' (or 'v := e') would have the same effect.

It does not flag variables under the following conditions, to reduce the number of false positives: - global variables – these often specify types to aid godoc - files that use cgo – cgo code generation and pointer checking emits redundant types

It does not flag variables under the following conditions, unless flagHelpfulTypes is true, to reduce the number of noisy positives: - packages that import syscall or unsafe – these sometimes use this form of assignment to make sure types are as expected - variables named the blank identifier – a pattern used to confirm the types of variables - untyped expressions on the rhs – the explicitness might aid readability


This section is empty.

Source Files

Jump to

Keyboard shortcuts

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