S023

package
v0.28.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: MPL-2.0 Imports: 4 Imported by: 0

README

S023

The S023 analyzer reports cases of schema including Elem that should be removed with incompatible Type.

Flagged Code

&schema.Schema{
  Elem: &schema.Schema{},
  Type: TypeBool,
}

&schema.Schema{
  Elem: &schema.Schema{},
  Type: TypeFloat,
}

&schema.Schema{
  Elem: &schema.Schema{},
  Type: TypeInt,
}

&schema.Schema{
  Elem: &schema.Schema{},
  Type: TypeString,
}

Passing Code

&schema.Schema{
  Type: TypeBool,
}

&schema.Schema{
  Type: TypeFloat,
}

&schema.Schema{
  Type: TypeInt,
}

&schema.Schema{
  Type: TypeString,
}

Ignoring Reports

Singular reports can be ignored by adding the a //lintignore:S023 Go code comment at the end of the offending line or on the line immediately proceding, e.g.

//lintignore:S023
&schema.Schema{
  Elem: &schema.Schema{},
  Type: TypeBool,
}

Documentation

Overview

Package S023 defines an Analyzer that checks for Schema that should omit Elem with incompatible Type

Index

Constants

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

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: analyzerName,
	Doc:  Doc,
	Requires: []*analysis.Analyzer{
		schemainfo.Analyzer,
		commentignore.Analyzer,
	},
	Run: run,
}

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