sharedcheck

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRangeStringRunes

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

func RedundantTypeInDeclarationChecker added in v0.2.0

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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