S021

package
v1.0.2 Latest Latest
Warning

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

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

README

S021

The S021 analyzer reports cases of schemas including ComputedWhen, which should be removed.

Flagged Code

&schema.Schema{
    Computed:     true,
    ComputedWhen: []string{"another_attr"},
}

Passing Code

&schema.Schema{
    Computed: true,
}

Ignoring Reports

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

//lintignore:S021
&schema.Schema{
    Computed:     true,
    ComputedWhen: []string{"another_attr"},
}

Documentation

Overview

Package S021 defines an Analyzer that checks for Schema that should omit ComputedWhen

Index

Constants

View Source
const Doc = `` /* 139-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